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 Storage Daemon"
14 DAEMON=@sbindir@/${NAME}
17 BOPTIONS="-c @sysconfdir@/${NAME}.conf"
20 PATH=/sbin:/bin:/usr/sbin:/usr/bin
22 test -f $DAEMON || exit 0
25 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
30 if [ -n "`getent services ${NAME}`" ]; then
31 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
35 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
37 if [ "x${BUSER}" != "x" ]; then
38 BOPTIONS="${BOPTIONS} -u ${BUSER}"
40 if [ "x${BGROUP}" != "x" ]; then
41 BOPTIONS="${BOPTIONS} -g ${BGROUP}"
46 echo -n "Starting ${DESC}: "
47 start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS}
51 echo -n "Stopping ${DESC}: "
52 start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS}
61 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2