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@
13 DESC="Bacula Director"
14 DAEMON=@sbindir@/${NAME}
17 BOPTIONS="-c @sysconfdir@/${NAME}.conf"
20 PATH=/sbin:/bin:/usr/sbin:/usr/bin
22 test -f $DAEMON || exit 0
24 if [ -n "`getent services ${NAME}`" ]; then
25 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
28 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
30 if [ "x${BUSER}" != "x" ]; then
31 BOPTIONS="${BOPTIONS} -u ${BUSER}"
33 if [ "x${BGROUP}" != "x" ]; then
34 BOPTIONS="${BOPTIONS} -g ${BGROUP}"
39 echo -n "Starting ${DESC}: "
40 start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS}
44 echo -n "Stopping ${DESC}: "
45 start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS}
54 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2