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 GNU Hurd systems.
9 # Kern E. Sibbald - 21 March 2008
11 # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
15 # Required-Start: $network
16 # Required-Stop: $network
17 # Default-Start: 2 3 4 5
19 # Short-Description: Start @BACULA@ Storage daemon at boot time
20 # Description: Enable @BACULA@ Storage daemon.
25 DESC="@BACULA@ Storage Daemon"
26 DAEMON=@sbindir@/${NAME}
29 BOPTIONS="-c @sysconfdir@/${NAME}.conf"
32 PATH=/sbin:/bin:/usr/sbin:/usr/bin
34 test -f $DAEMON || exit 0
36 if [ -n "`getent services ${NAME}`" ]; then
37 BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
40 if [ -f /etc/default/$NAME ]; then
44 PIDFILE=@piddir@/${NAME}.${BPORT}.pid
46 if [ "x${BUSER}" != "x" ]; then
47 USERGRP="--chuid ${BUSER}"
48 if [ "x${BGROUP}" != "x" ]; then
49 USERGRP="${USERGRP}:${BGROUP}"
56 echo -n "Starting ${DESC}: "
57 start-stop-daemon --start --quiet --pidfile ${PIDFILE} ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
62 echo -n "Stopping ${DESC}: "
63 start-stop-daemon --oknodo --stop --quiet ${USERGRP} --exec ${DAEMON} -- ${BOPTIONS}
74 echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2