CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
tar: updated to 1.30
[crossrootfs.git] / sysklogd / sysklogd
... / ...
CommitLineData
1#!/bin/sh
2#
3# /etc/rc.d/sysklogd: start/stop syslog and klog daemons
4#
5
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
23case $1 in
24start)
25 $SSD --start --pidfile $SLOG_PID --exec $SLOG
26 $SSD --start --pidfile $KLOG_PID --exec $KLOG -- -c4
27 ;;
28stop)
29 $SSD --stop --retry 10 --pidfile $SLOG_PID
30 $SSD --stop --retry 10 --pidfile $KLOG_PID
31 ;;
32restart)
33 $0 stop
34 $0 start
35 ;;
36status)
37 print_status $SLOG $SLOG_PID
38 print_status $KLOG $KLOG_PID
39 ;;
40*)
41 echo "usage: $0 [start|stop|restart|status]"
42 ;;
43esac
44
45# End of file