diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-06-20 22:27:45 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-06-20 22:27:45 +0000 |
commit | e26b546ee463cdbe2433367f6bcb9aec476fbee0 (patch) | |
tree | 5da6536e752b83f134b4038100b46565452469c0 /initscript/Debian | |
parent | 78fb052e89e9063ab985c1ad3c3ce10e47d1621d (diff) |
Add patches from Sebastien Estienne
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@131 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'initscript/Debian')
-rwxr-xr-x | initscript/Debian/15avahi.in | 77 | ||||
-rw-r--r-- | initscript/Debian/Makefile.am | 4 |
2 files changed, 81 insertions, 0 deletions
diff --git a/initscript/Debian/15avahi.in b/initscript/Debian/15avahi.in new file mode 100755 index 0000000..73a0c73 --- /dev/null +++ b/initscript/Debian/15avahi.in @@ -0,0 +1,77 @@ +#! /bin/sh +# +# avahi avahi daemon +# Daemon for ZeroConf +# +# Authors: <sebastien.estienne@gmail.com> +# + +. /lib/lsb/init-functions + +set -e + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC="Avahi ZeroConf daemon" +NAME="avahi" +DAEMON=/usr/bin/$NAME +PIDDIR=/var/run/$NAME +PIDFILE=$PIDDIR/$NAME.pid +DAEMONUSER=@AVAHI_USER@ +DAEMONGRP=@AVAHI_GROUP@ + + + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +# +# Function that starts the daemon/service. +# +d_start() { + if [ ! -d $PIDDIR ]; then + mkdir -p $PIDDIR + fi + chown -R $DAEMONUSER:$DAEMONGRP $PIDDIR + + start-stop-daemon --start \ + --background --chuid $DAEMONUSER \ + -m --pidfile $PIDFILE \ + --exec $DAEMON -- $DAEMON_OPTS + +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --oknodo --quiet --pidfile $PIDFILE \ + --exec $DAEMON + +} + + +case "$1" in + start) + log_begin_msg "Starting $DESC: $NAME" + d_start + log_end_msg $? + ;; + stop) + log_begin_msg "Stopping $DESC: $NAME" + d_stop + log_end_msg $? + ;; + restart|force-reload) + log_begin_msg "Restarting $DESC: $NAME" + d_stop + sleep 1 + d_start + log_end_msg $? + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/initscript/Debian/Makefile.am b/initscript/Debian/Makefile.am new file mode 100644 index 0000000..fd274dc --- /dev/null +++ b/initscript/Debian/Makefile.am @@ -0,0 +1,4 @@ +dbusinitddir = $(sysconfdir)/dbus-1/event.d +dbusinitd_SCRIPTS = 15avahi + +EXTRA_DIST = $(dbusinitd_SCRIPTS) |