3 # bacula This shell script takes care of starting and stopping
4 # the bacula Director daemon on Debian/Ubuntu/Kubuntu
7 # Kern E. Sibbald - 21 March 2008
9 # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
12 # Provides: bacula-dir
13 # Required-Start: $network
14 # Required-Stop: $network
15 # Default-Start: 2 3 4 5
17 # Short-Description: Start @BACULA@ Director daemon at boot time
18 # Description: Enable @BACULA@ Director.
23 DESC="@BACULA@ Director"
24 DAEMON=@sbindir@/${NAME}
27 BOPTIONS="-c @sysconfdir@/${NAME}.conf"
30 PATH=/sbin:/bin:/usr/sbin:/usr/bin
32 test -f $DAEMON || exit 0
34 if [ -n "`getent services ${NAME}`" ]; then
35 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
38 if [ -f /etc/default/$NAME ]; then
42 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
44 if [ "x${BUSER}" != "x" ]; then
45 USERGRP="--chuid ${BUSER}"
46 if [ "x${BGROUP}" != "x" ]; then
47 USERGRP="${USERGRP}:${BGROUP}"
53 echo -n "Starting ${DESC}: "
54 start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
59 echo -n "Stopping ${DESC}: "
60 start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
70 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2