3 # avahi-daemon: Starts the Avahi Daemon
6 # description: This is a daemon which runs on client machines to perform \
7 # Zeroconf service discovery on a network. avahi-daemon must be \
8 # running on systems that use Avahi for service discovery. \
9 # Avahi-daemon should not be running otherwise.
10 # processname: avahi-daemon
11 # pidfile: @localstatedir@/run/avahi-daemon/pid
13 AVAHI_BIN=@sbindir@/avahi-daemon
16 if [ "$1" = 'status' ]; then
17 test -x $AVAHI_BIN || exit 4
19 test -x $AVAHI_BIN || exit 5
22 # Source function library.
23 . /etc/init.d/functions
24 . /etc/sysconfig/network
26 LOCKFILE=@localstatedir@/lock/subsys/avahi-daemon
27 PIDFILE=@localstatedir@/run/avahi-daemon/pid
33 # Check that networking is configured.
34 [ ${NETWORKING} = "no" ] && exit 1
36 echo -n $"Starting Avahi daemon... "
37 if [ -s /etc/localtime ]; then
38 cp -fp /etc/localtime /etc/avahi/etc >/dev/null 2>&1
40 daemon --pidfile=${PIDFILE} $AVAHI_BIN $AVAHI_OPTS
43 [ $RETVAL -eq 0 ] && touch ${LOCKFILE}
48 echo -n $"Shutting down Avahi daemon: "
49 killproc -p ${PIDFILE} $AVAHI_BIN
51 [ $RETVAL -eq 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
57 echo -n $"Reloading Avahi daemon... "
58 killproc -p ${PIDFILE} $AVAHI_BIN -HUP
71 # See how we were called.
80 status -p ${PIDFILE} $AVAHI_BIN
90 if [ -f $LOCKFILE ]; then
95 echo $"Usage: $0 {start|stop|status|restart|condrestart}"