Create a new file /etc/init.d/sysklogd containing the following:
#!/bin/sh
# Begin /etc/init.d/sysklogd
check_status()
{
if [ $? = 0 ]
then
echo "OK"
else
echo "FAILED"
fi
}
case "$1" in
start)
echo -n "Starting system log daemon..."
start-stop-daemon -S -q -o -x /usr/sbin/syslogd -- -m 0
check_status
echo -n "Starting kernel log daemon..."
start-stop-daemon -S -q -o -x /usr/sbin/klogd
check_status
;;
stop)
echo -n "Stopping kernel log daemon..."
start-stop-daemon -K -q -o -p /var/run/klogd.pid
check_status
echo -n "Stopping system log daemon..."
start-stop-daemon -K -q -o -p /var/run/syslogd.pid
check_status
;;
reload)
echo -n "Reloading system load daemon configuration file..."
start-stop-daemon -K -q -o -s 1 -p /var/run/syslogd.pid
check_status
;;
restart)
echo -n "Stopping kernel log daemon..."
start-stop-daemon -K -q -o -p /var/run/klogd.pid
check_status
echo -n "Stopping system log daemon..."
start-stop-daemon -K -q -o -p /var/run/syslogd.pid
check_status
sleep 1
echo -n "Starting system log daemon..."
start-stop-daemon -S -q -o -x /usr/sbin/syslogd -- -m 0
check_status
echo -n "Starting kernel log daemon..."
start-stop-daemon -S -q -o -x /usr/sbin/klogd
check_status
;;
*)
echo "Usage: $0 {start|stop|reload|restart}"
exit 1
;;
esac
# End /etc/init.d/sysklogd