summaryrefslogtreecommitdiff
path: root/laptop/init.d/local-sysklogd
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-09-10 09:21:31 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-09-10 09:21:31 +0000
commitd7fa158e242fe9c89d78122564a67b238330d06f (patch)
tree5185368cd5aeefa2cc4f757d825dbbe186f06a14 /laptop/init.d/local-sysklogd
parent23f4868cd37fdba409f3004a9a1164fa483b7ac8 (diff)
r9702@danube: weasel | 2006-09-10 11:21:03 +0200
Add busybox syslogd for laptops git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@182 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'laptop/init.d/local-sysklogd')
-rwxr-xr-xlaptop/init.d/local-sysklogd50
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