4
# Required-Start: $remote_fs $syslog
5
# Required-Stop: $remote_fs $syslog
6
# Default-Start: 2 3 4 5
8
# Short-Description: Start Bacula Storage Daemon at boot time
9
# Description: bacula-sd is daemon that perform the storage and recovery
10
# of the file attributes and data to the physical backup
11
# media or volumes. In other words, the Storage daemon is
12
# responsible for reading and writing your tapes (or other
13
# storage media, e.g. files).
16
# bacula-fd SysV init script for Bacula-FD.
18
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
19
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>
20
# Customized for Bacula by Jose Luis Tallon <jltallon@adv-solutions.net>
25
PATH=/sbin:/bin:/usr/sbin:/usr/bin
26
DAEMON=/usr/sbin/bacula-sd
29
DESC="Bacula Storage daemon"
31
test -x $DAEMON || exit 0
33
if [ -n "`getent services bacula-sd`" ]; then
34
PORT=`getent services bacula-sd | awk '{ gsub("/tcp","",$2); print $2; }'`
37
. /lib/lsb/init-functions
38
. /usr/share/bacula-common/common-functions.init
39
if [ -r /etc/default/$NAME ]; then
43
CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
47
PIDFILE=/var/run/bacula/$NAME.$PORT.pid
51
start-stop-daemon --start --quiet --pidfile $PIDFILE \
52
--oknodo --exec $DAEMON -- -c $CONFIG $ARGS
57
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
58
--retry TERM/30/KILL/5 --exec $DAEMON -- -c $CONFIG $ARGS
63
if [ "$ENABLED" = "no" ]; then
64
log_failure_msg "Not starting $DESC: disabled via /etc/default/$NAME"
68
log_daemon_msg "Starting $DESC..." "$NAME"
76
log_daemon_msg "Stopping $DESC..." "$NAME"
90
status_of_proc -p $PIDFILE $DAEMON $NAME
94
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2