]> git.meshlink.io Git - catta/blob - initscript/suse/avahi-daemon.in
fix on SuSe when avahi-dnsconfd is started before avahi-daemon closing bug #31
[catta] / initscript / suse / avahi-daemon.in
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides:       avahi
4 # Required-Start: $network dbus
5 # Default-Start:  3 5
6 # Default-Stop:
7 # Description: Avahi, a ZeroConf daemon for mDNS and service registration
8 ### END INIT INFO
9
10 AVAHI_BIN=@sbindir@/avahi-daemon
11 test -x $AVAHI_BIN || exit 5
12
13 . /etc/rc.status
14 rc_reset
15
16 case "$1" in
17     start)
18         echo -n "Starting Avahi daemon"
19         /sbin/startproc $AVAHI_BIN -D
20         rc_check
21         for (( n=0 ; n<10 ; n++ )) ; do
22             if test -f /var/run/avahi-daemon/pid ; then
23                 break
24             else
25                 echo -n "."
26                 sleep 1
27             fi
28         done
29         rc_status -v
30         ;;
31     stop)
32         echo -n "Shutting down Avahi daemon"
33         $AVAHI_BIN -k || /bin/true
34         rc_status -v
35         ;;
36     restart)
37         $0 stop
38         $0 start
39         rc_status
40         ;;
41     force-reload|reload)
42         echo -n "Reloading Avahi daemon"
43         $AVAHI_BIN -r
44         rc_status -v
45         ;;
46     status)
47         echo -n "Checking for Avahi daemon: "
48         $AVAHI_BIN -c
49         rc_status -v
50         ;;
51     *)
52         echo "Usage: $0 {start|stop|status|restart|force-reload|reload}"
53         exit 1
54         ;;
55 esac
56