3 # bacula This shell script takes care of starting and stopping
4 # the bacula Director daemon on Debian GNU Hurd systems.
6 # Kern E. Sibbald - 21 March 2008
8 # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
11 # Provides: bacula-dir
12 # Required-Start: $network
13 # Required-Stop: $network
14 # Default-Start: 2 3 4 5
16 # Short-Description: Start @BACULA@ Director daemon at boot time
17 # Description: Enable @BACULA@ Director.
22 DESC="@BACULA@ Director"
23 DAEMON=@sbindir@/${NAME}
26 BOPTIONS="-c @sysconfdir@/${NAME}.conf"
29 PATH=/sbin:/bin:/usr/sbin:/usr/bin
31 test -f $DAEMON || exit 0
33 if [ -n "`getent services ${NAME}`" ]; then
34 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
37 if [ -f /etc/default/$NAME ]; then
41 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
43 if [ "x${BUSER}" != "x" ]; then
44 USERGRP="--chuid ${BUSER}"
45 if [ "x${BGROUP}" != "x" ]; then
46 USERGRP="${USERGRP}:${BGROUP}"
52 echo -n "Starting ${DESC}: "
53 start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
58 echo -n "Stopping ${DESC}: "
59 start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
69 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2