blob: 2475f60d308ee340c7645c5bf72ce0b14a10cd53 (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/deadwood: start/stop deadwood DNS resolver
4 #
5
6 SSD=/sbin/start-stop-daemon
7 PROG=/usr/sbin/maradns
8 PID=/var/run/maradns.pid
9 LOG=/var/log/maradns.log
10
11 case $1 in
12 start)
13 $SSD --start -bmC --pidfile $PID --exec $PROG >> $LOG 2>&1
14 RETVAL=$?
15 ;;
16 stop)
17 $SSD --stop --remove-pidfile --retry 10 --pidfile $PID
18 RETVAL=$?
19 ;;
20 restart)
21 $0 stop
22 $0 start
23 ;;
24 status)
25 $SSD --status --pidfile $PID
26 case $? in
27 0) echo "$PROG is running with pid $(cat $PID)" ;;
28 1) echo "$PROG is not running but the pid file $PID exists" ;;
29 3) echo "$PROG is not running" ;;
30 4) echo "Unable to determine the program status" ;;
31 esac
32 ;;
33 *)
34 echo "usage: $0 [start|stop|restart|status]"
35 ;;
36 esac
37
38 exit $RETVAL
39
40 # End of file
|