Commit | Line | Data |
---|---|---|
6dca1d21 JB |
1 | #!/bin/sh |
2 | # | |
3627dae3 | 3 | # /etc/rc.d/sysklogd: start/stop syslog and klog daemons |
6dca1d21 JB |
4 | # |
5 | ||
3627dae3 VM |
6 | SSD=/sbin/start-stop-daemon |
7 | SLOG=/usr/sbin/syslogd | |
8 | KLOG=/usr/sbin/klogd | |
9 | SLOG_PID=/var/run/syslogd.pid | |
10 | KLOG_PID=/var/run/klogd.pid | |
11 | ||
12 | ||
13 | print_status() { | |
14 | $SSD --status --pidfile $2 | |
15 | case $? in | |
16 | 0) echo "$1 is running with pid $(cat $2)" ;; | |
17 | 1) echo "$1 is not running but the pid file $2 exists" ;; | |
18 | 3) echo "$1 is not running" ;; | |
19 | 4) echo "Unable to determine the program status" ;; | |
20 | esac | |
21 | } | |
22 | ||
6dca1d21 JB |
23 | case $1 in |
24 | start) | |
3627dae3 VM |
25 | $SSD --start --pidfile $SLOG_PID --exec $SLOG |
26 | $SSD --start --pidfile $KLOG_PID --exec $KLOG -- -c4 | |
6dca1d21 JB |
27 | ;; |
28 | stop) | |
3627dae3 VM |
29 | $SSD --stop --retry 10 --pidfile $SLOG_PID |
30 | $SSD --stop --retry 10 --pidfile $KLOG_PID | |
6dca1d21 JB |
31 | ;; |
32 | restart) | |
33 | $0 stop | |
6dca1d21 JB |
34 | $0 start |
35 | ;; | |
3627dae3 VM |
36 | status) |
37 | print_status $SLOG $SLOG_PID | |
38 | print_status $KLOG $KLOG_PID | |
39 | ;; | |
6dca1d21 | 40 | *) |
3627dae3 | 41 | echo "usage: $0 [start|stop|restart|status]" |
6dca1d21 JB |
42 | ;; |
43 | esac | |
3627dae3 VM |
44 | |
45 | # End of file |