summaryrefslogtreecommitdiff
path: root/laptop/init.d/local-sysklogd
blob: fe27346e30227f7c3400ddf4aea752c9f5d8e1fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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