2 # bacula-director SysV init script for Bacula-FD.
4 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
5 # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
6 # Customized for Bacula by Jose Luis Tallon <jltallon@adv-solutions.net>
7 # Modified RJM 2-12-03 to fix errors with pidfile name
9 PATH=/sbin:/bin:/usr/sbin:/usr/bin
10 DAEMON=/usr/sbin/bacula-dir
13 DESC="Bacula Director"
14 ARGS="-c /etc/bacula/bacula-dir.conf -u bacula -g bacula"
16 test -f $DAEMON || exit 0
20 if [ -n "`getent services bacula-dir`" ]; then
21 PORT=`getent services bacula-dir | awk '{ gsub("/tcp","",$2); print $2; }'`
24 PIDFILE=/var/run/bacula/$NAME.$PORT.pid
28 if [ -f /etc/bacula/do_not_run ]; then
29 echo "Not starting $DESC: disabled via /etc/bacula/do_not_run"
33 echo -n "Starting $DESC: "
34 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $ARGS
39 echo -n "Stopping $DESC: "
40 start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE --exec $DAEMON
45 echo -n "Restarting $DESC: "
46 start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
48 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $ARGS
53 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
54 echo "Usage: $N {start|stop|restart|force-reload}" >&2