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 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
40 if [ "x${BUSER}" != "x" ]; then
41 BOPTIONS="${BOPTIONS} -u ${BUSER}"
43 if [ "x${BGROUP}" != "x" ]; then
44 BOPTIONS="${BOPTIONS} -g ${BGROUP}"
49 echo -n "Starting ${DESC}: "
50 start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS}
54 echo -n "Stopping ${DESC}: "
55 start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS}
64 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2