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@
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 File Daemon
19 # Description: Bacula is a network backup and restore program
24 DESC="Bacula File Daemon"
25 DAEMON=@sbindir@/${NAME}
28 BOPTIONS="-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; }'`
45 if [ -f /etc/default/$NAME ]; then
50 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
52 if [ "x${BUSER}" != "x" ]; then
53 USERGRP="--chuid ${BUSER}"
54 if [ "x${BGROUP}" != "x" ]; then
55 USERGRP="${USERGRP}:${BGROUP}"
61 echo -n "Starting ${DESC}: "
62 start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
67 echo -n "Stopping ${DESC}: "
68 start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
78 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2