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 # Provides: bacula-sdr
14 # Required-Start: $local_fs $remote_fs $network $time
15 # Required-Stop: $local_fs $remote_fs $network $time
16 # Default-Start: 2 3 4 5
18 # Short-Description: Bacula Storage Daemon
19 # Description: Bacula is a network backup and restore program
24 DESC="Bacula Storage Daemon"
25 DAEMON=@sbindir@/${NAME}
28 USERGRP="-c @sysconfdir@/${NAME}.conf"
31 PATH=/sbin:/bin:/usr/sbin:/usr/bin
33 test -f $DAEMON || exit 0
36 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
41 if [ -n "`getent services ${NAME}`" ]; then
42 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
46 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
48 if [ "x${BUSER}" != "x" ]; then
49 USERGRP="--chuid ${BUSER}"
50 if [ "x${BGROUP}" != "x" ]; then
51 USERGRP="${BOPTIONS}:${BGROUP}"
57 echo -n "Starting ${DESC}: "
58 start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON}
63 echo -n "Stopping ${DESC}: "
64 start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON}
74 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2