Blame SOURCES/bacula-sd.init

811809
#!/bin/sh
811809
#
811809
# bacula-sd Takes care of starting and stopping the Bacula Storage Daemon.
811809
#
811809
# chkconfig: - 80 20
811809
# description: The Bacula Storage Daemon is the daemon responsible for saving \
811809
#              backed up data on the various File Daemon to the appropriate \
811809
#              storage devices.
811809
811809
### BEGIN INIT INFO
811809
# Required-Start: $local_fs $network
811809
# Required-Stop: $local_fs $network
811809
# Default-Start: 3 4 5
811809
# Default-Stop: 0 1 2 6
811809
# Short-Description: Bacula Storage Daemon.
811809
# Description: The Bacula Storage Daemon is the daemon responsible for saving
811809
#              backed up data on the various File Daemon to the appropriate
811809
#              storage devices.
811809
### END INIT INFO
811809
811809
# Source function library.
811809
. /etc/init.d/functions
811809
811809
exec="/usr/sbin/bacula-sd"
811809
prog="bacula-sd"
811809
CONFIG="/etc/bacula/bacula-sd.conf"
811809
OPTS="-c $CONFIG"
811809
811809
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
811809
811809
lockfile=/var/lock/subsys/$prog
811809
811809
if [ "$SD_USER" != '' ]; then
811809
        OPTS="$OPTS -u $SD_USER"
811809
fi
811809
811809
if [ "$SD_GROUP" != '' ]; then
811809
        OPTS="$OPTS -g $SD_GROUP"
811809
fi
811809
811809
start() {
811809
    [ -x $exec ] || exit 5
811809
    [ -f $config ] || exit 6
811809
    echo -n $"Starting $prog: "
811809
    daemon $prog $OPTS
811809
    retval=$?
811809
    echo
811809
    [ $retval -eq 0 ] && touch $lockfile
811809
    return $retval
811809
}
811809
811809
stop() {
811809
    echo -n $"Stopping $prog: "
811809
    killproc $prog
811809
    retval=$?
811809
    echo
811809
    [ $retval -eq 0 ] && rm -f $lockfile
811809
    return $retval
811809
}
811809
811809
restart() {
811809
    stop
811809
    sleep 2
811809
    start
811809
}
811809
811809
reload() {
811809
    restart
811809
}
811809
811809
force_reload() {
811809
    restart
811809
}
811809
811809
rh_status() {
811809
    # run checks to determine if the service is running or use generic status
811809
    status $prog
811809
}
811809
811809
rh_status_q() {
811809
    rh_status >/dev/null 2>&1
811809
}
811809
811809
811809
case "$1" in
811809
    start)
811809
        rh_status_q && exit 0
811809
        $1
811809
        ;;
811809
    stop)
811809
        rh_status_q || exit 0
811809
        $1
811809
        ;;
811809
    restart)
811809
        $1
811809
        ;;
811809
    reload)
811809
        rh_status_q || exit 7
811809
        $1
811809
        ;;
811809
    force-reload)
811809
        force_reload
811809
        ;;
811809
    status)
811809
        rh_status
811809
        ;;
811809
    condrestart|try-restart)
811809
        rh_status_q || exit 0
811809
        restart
811809
        ;;
811809
    *)
811809
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
811809
        exit 2
811809
esac
811809
exit $?