#! /bin/sh # # bacula This shell script takes care of starting and stopping # the bacula Director daemon on Debian/Ubuntu/Kubuntu # systems. # # Kern E. Sibbald - 21 March 2008 # # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ # NAME="bacula-fd" DESC="Bacula File Daemon" DAEMON=@sbindir@/${NAME} BUSER=@fd_user@ BGROUP=@fd_group@ BOPTIONS="-c @sysconfdir@/${NAME}.conf" BPORT=@fd_port@ PATH=/sbin:/bin:/usr/sbin:/usr/bin test -f $DAEMON || exit 0 if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi PIDFILE=@piddir@/${NAME}.${BPORT}.pid if [ "x${BUSER}" != "x" ]; then BOPTIONS="${BOPTIONS} -u ${BUSER}" fi if [ "x${BGROUP}" != "x" ]; then BOPTIONS="${BOPTIONS} -g ${BGROUP}" fi case "$1" in start) echo -n "Starting ${DESC}: " start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS} echo "${NAME}" ;; stop) echo -n "Stopping ${DESC}: " start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS} echo "${NAME}" ;; restart|force-reload) $0 stop sleep 5 $0 start ;; *) echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0