#! /bin/sh # # bacula This shell script takes care of starting and stopping # the bacula Storage daemon. # # chkconfig: 2345 90 99 # description: It comes by night and sucks the vital essence from your computers. # # Source function library . /etc/rc.d/init.d/functions case "$1" in start) msg_starting "Bacula Storage" daemon /usr/sbin/bacula-sd $2 -c /etc/bacula/bacula-sd.conf RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-sd ;; stop) msg_stopping "Bacula Storage" killproc /usr/sbin/bacula-sd RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-sd ;; restart) $0 stop && sleep 5 $0 start RETVAL=$? ;; status) status /usr/sbin/bacula-sd RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac exit $RETVAL