blob: c6bd3fea9bd34276a044497a3c741a592facac3e (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/avahi-daemon: start/stop avahi daemon
4 #
5
6 SSD=/sbin/start-stop-daemon
7 PROG=/usr/sbin/avahi-daemon
8 NAME=avahi-daemon
9 RUNDIR=/run/avahi-daemon
10 PID=$RUNDIR/pid
11 USER=avahi
12 GROUP=avahi
13 OPTS="-D"
14
15 case $1 in
16 start)
17 [ -d "$RUNDIR" ] || install -o $USER -g $GROUP -d "$RUNDIR"
18 $SSD --start --pidfile $PID --user $USER --exec $PROG -- $OPTS
19 ;;
20 stop)
21 $SSD --stop --retry 10 --name $NAME --pidfile $PID
22 ;;
23 restart)
24 $0 stop
25 $0 start
26 ;;
27 status)
28 $SSD --status --name $NAME --pidfile $PID
29 case $? in
30 0) echo "$PROG is running with pid $(cat $PID)" ;;
31 1) echo "$PROG is not running but the pid file $PID exists" ;;
32 3) echo "$PROG is not running" ;;
33 4) echo "Unable to determine the program status" ;;
34 esac
35 ;;
36 *)
37 echo "usage: $0 [start|stop|restart|status]"
38 ;;
39 esac
40
41 # End of file
|