]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula-sd.in
- Modified detection of largefiles to always set all flags regardless
[bacula/bacula] / bacula / platforms / redhat / 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 9
7 # description: It comes by night and sucks the vital essence from your computers.
8 #
9 #  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
10 #
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 SD_USER=@sd_user@
16 SD_GROUP=@sd_group@
17
18 case "$1" in
19     start)
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        echo -n "Starting the Bacula Storage daemon: "
30        daemon @sbindir@/bacula-sd $2 ${OPTIONS} -c @sysconfdir@/bacula-sd.conf
31        RETVAL=$?
32        echo
33        [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd
34        ;;
35     stop)
36        echo -n "Stopping the Bacula Storage daemon: "
37        killproc @sbindir@/bacula-sd
38        RETVAL=$?
39        echo
40        [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-sd
41        ;;
42     restart)
43        $0 stop
44        sleep 5
45        $0 start
46        ;;
47     status)
48        status @sbindir@/bacula-sd
49        ;;
50     *)
51        echo "Usage: $0 {start|stop|restart|status}"
52        exit 1
53        ;;
54 esac
55 exit 0