CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
libcap: updated to 2.25-2
[crossrootfs.git] / sysklogd / sysklogd
CommitLineData
6dca1d21
JB
1#!/bin/sh
2#
3627dae3 3# /etc/rc.d/sysklogd: start/stop syslog and klog daemons
6dca1d21
JB
4#
5
3627dae3
VM
6SSD=/sbin/start-stop-daemon
7SLOG=/usr/sbin/syslogd
8KLOG=/usr/sbin/klogd
9SLOG_PID=/var/run/syslogd.pid
10KLOG_PID=/var/run/klogd.pid
11
12
13print_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
23case $1 in
24start)
3627dae3
VM
25 $SSD --start --pidfile $SLOG_PID --exec $SLOG
26 $SSD --start --pidfile $KLOG_PID --exec $KLOG -- -c4
6dca1d21
JB
27 ;;
28stop)
3627dae3
VM
29 $SSD --stop --retry 10 --pidfile $SLOG_PID
30 $SSD --stop --retry 10 --pidfile $KLOG_PID
6dca1d21
JB
31 ;;
32restart)
33 $0 stop
6dca1d21
JB
34 $0 start
35 ;;
3627dae3
VM
36status)
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 ;;
43esac
3627dae3
VM
44
45# End of file