Rev 4 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/sh## avahi-daemon: Starts the Avahi mDNS/DNS-SD Stack## chkconfig: 345 24 02# description: This is a daemon which runs on client machines to \# perform Zeroconf service discovery on a \# network. avahi-daemon must be running on systems that \# use Avahi for service discovery. Avahi-daemon should \# not be running otherwise.# processname: avahi-daemon# pidfile: /var/run/avahi-daemon/pid### BEGIN INIT INFO# Required-Start: messagebus# Required-Stop: messagebus# Should-Start: $syslog $network $local_fs# Should-Stop: $syslog $local_fs# Default-Start: 3 4 5# Default-Stop: 0 1 2 6# Short-Description: Starts the Avahi Daemon# Description: This is a daemon which runs on client machines to# perform Zeroconf service discovery on a# network. avahi-daemon must be running on systems# that use Avahi for service discovery.# Avahi-daemon should not be running otherwise.### END INIT INFOAVAHI_BIN=/usr/sbin/avahi-daemonAVAHI_OPTS="-D"if [ "$1" = 'status' ]; thentest -x $AVAHI_BIN || exit 4elsetest -x $AVAHI_BIN || exit 5fi# Source function library.. /etc/init.d/functions. /etc/sysconfig/networkLOCKFILE=/var/lock/subsys/avahi-daemonPIDFILE=/var/run/avahi-daemon/pidRETVAL=0base=${0##*/}start() {# Check that networking is configured.[ ${NETWORKING} = "no" ] && exit 1[ "$EUID" != "0" ] && exit 4echo -n $"Starting Avahi daemon... "if [ -s /etc/localtime ]; thencp -fp /etc/localtime /etc/avahi/etc >/dev/null 2>&1fi;daemon --pidfile=${PIDFILE} $AVAHI_BIN $AVAHI_OPTSRETVAL=$?echo[ $RETVAL -eq 0 ] && touch ${LOCKFILE}return $RETVAL}stop() {[ "$EUID" != "0" ] && exit 4echo -n $"Shutting down Avahi daemon: "killproc -p ${PIDFILE} $AVAHI_BINRETVAL=$?[ $RETVAL -eq 0 ] && rm -f ${LOCKFILE} ${PIDFILE}echoreturn $RETVAL}reload() {echo -n $"Reloading Avahi daemon... "killproc -p ${PIDFILE} $AVAHI_BIN -HUPRETVAL=$?echoreturn $RETVAL}restart() {[ "$EUID" != "0" ] && exit 4stopstart}RETVAL=0# See how we were called.case "$1" instart)start;;stop)stop;;status)status -p ${PIDFILE} $AVAHI_BINRETVAL=$?;;restart)restart;;reload|force-reload)reload;;condrestart|try-restart)if [ -f $LOCKFILE ]; thenrestartfi;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"exit 2;;esacexit $RETVAL