diff options
Diffstat (limited to 'laptop/init.d/local-sysklogd')
-rwxr-xr-x | laptop/init.d/local-sysklogd | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/laptop/init.d/local-sysklogd b/laptop/init.d/local-sysklogd new file mode 100755 index 0000000..fe27346 --- /dev/null +++ b/laptop/init.d/local-sysklogd @@ -0,0 +1,50 @@ +#! /bin/sh +# +set -e + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DESC="busybox sysklog" +DAEMON=/usr/local/bin/busybox +PIDFILE_SYSLOG=/var/run/busybox-syslog.pid +PIDFILE_KLOG=/var/run/busybox-klog.pid + +test -x $DAEMON || exit 0 + +d_start() { + echo -n "Starting $DESC: " + echo -n "syslogd, " + start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE_SYSLOG --startas $DAEMON -- syslogd -C 128 -n + echo -n "klog" + start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE_KLOG --startas $DAEMON -- klogd -n + echo "." +} + +d_stop() { + echo -n "Stopping $DESC: " + echo -n "syslogd, " + start-stop-daemon --stop --quiet --pidfile $PIDFILE_SYSLOG --name busybox + echo -n "klog" + start-stop-daemon --stop --quiet --pidfile $PIDFILE_KLOG --name busybox + echo "." +} + +cd / + +case "$1" in + start) + d_start + ;; + stop) + d_stop + ;; + restart|force-reload) + d_stop + d_start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 |