3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # bacula This shell script takes care of starting and stopping
7 # the bacula Director daemon on Debian/Ubuntu/Kubuntu
10 # Kern E. Sibbald - 21 March 2008
12 # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
17 # Required-Start: $local_fs $remote_fs $network $time
18 # Required-Stop: $local_fs $remote_fs $network $time
19 # Default-Start: 2 3 4 5
21 # Short-Description: Bacula File Daemon
22 # Description: Bacula is a network backup and restore program
27 DESC="Bacula File Daemon"
28 DAEMON=@sbindir@/${NAME}
31 BOPTIONS="-c @sysconfdir@/${NAME}.conf"
34 PATH=/sbin:/bin:/usr/sbin:/usr/bin
36 test -f $DAEMON || exit 0
39 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
44 if [ -n "`getent services ${NAME}`" ]; then
45 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
48 if [ -f /etc/default/$NAME ]; then
53 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
55 if [ "x${BUSER}" != "x" ]; then
56 USERGRP="--chuid ${BUSER}"
57 if [ "x${BGROUP}" != "x" ]; then
58 USERGRP="${USERGRP}:${BGROUP}"
65 echo -n "Starting ${DESC}: "
66 start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
71 echo -n "Stopping ${DESC}: "
72 start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
83 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2