]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/bacula.in
Split the bacula start/start script into four files:
[bacula/bacula] / bacula / scripts / bacula.in
1 #! /bin/sh
2 #
3 # bacula       This shell script takes care of starting and stopping
4 #              the bacula daemons.
5 #
6 #   This is pretty much watered down version of the RedHat script
7 #   that works on Solaris as well as Linux, but it won't work everywhere.
8 #
9 # description: It comes by night and sucks the vital essence from your computers.
10 #
11
12 # All these are not *really* needed but it makes it
13 #  easier to "steal" this code for the development 
14 #  environment where they are different.
15 #  
16 BACFDBIN=@sbindir@
17 BACFDCFG=@sysconfdir@
18 BACSDBIN=@sbindir@
19 BACSDCFG=@sysconfdir@
20 BACDIRBIN=@sbindir@
21 BACDIRCFG=@sysconfdir@
22
23 case "$1" in
24    start)
25       [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2
26       [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2
27       [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2
28       ;;
29
30    stop)
31       # Stop the FD first so that SD will fail jobs and update catalog
32       [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2
33       [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2
34       [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2
35       echo
36       ;;
37
38    restart)
39       $0 stop
40       sleep 5
41       $0 start
42       ;;
43
44    status)
45       [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd status
46       [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd status
47       [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir status
48       ;;
49
50    *)
51       echo "Usage: $0 {start|stop|restart|status}"
52       exit 1
53       ;;
54 esac
55 exit 0