]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/slackware/rc.bacula-sd.in
Change Byline
[bacula/bacula] / bacula / platforms / slackware / rc.bacula-sd.in
1 #! /bin/sh
2 #
3 # bacula       This shell script takes care of starting and stopping
4 #              the bacula Storage daemon.
5 #
6 # chkconfig: 2345 90 99
7 # description: The Leading Open Source Backup Solution.
8 #
9 #  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
10 #
11
12 # Source function library
13 . /etc/rc.d/functions.bacula
14
15 case "$1" in
16     start)
17         [ -x ${BACSDBIN}/bacula-sd ] && { 
18             sleep 2
19             echo -n "Starting the Storage daemon: "
20             OPTIONS=''
21             if [ "${SD_USER}" != '' ]; then
22                OPTIONS="${OPTIONS} -u ${SD_USER}"
23             fi
24
25             if [ "${SD_GROUP}" != '' ]; then
26                OPTIONS="${OPTIONS} -g ${SD_GROUP}"
27             fi
28
29             ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf
30             echo Done.
31         }
32         ;;
33     stop)
34         [ -x ${BACSDBIN}/bacula-sd ] && {
35             echo -n "Stopping the Storage daemon: "
36             killproc ${BACSDBIN}/bacula-sd ${SD_PORT}
37             echo Done.
38         }
39         ;;
40     restart)
41         $0 stop
42         sleep 5
43         $0 start
44         ;;
45     status)
46         [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT}
47         ;;
48     *)
49         echo "Usage: $0 {start|stop|restart|status}"
50         exit 1
51         ;;
52 esac
53 exit 0
54