]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/bacula.in
Change Byline
[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: The Leading Open Source Backup Solution.
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 SCRIPTDIR=@scriptdir@
17 #
18 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
19 #   good dumps
20 MALLOC_CHECK_=0
21 export MALLOC_CHECK_
22
23 case "$1" in
24    start)
25       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
26       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
27       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/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 ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
33       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
34       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2
35       ;;
36
37    restart)
38       $0 stop
39       sleep 2
40       $0 start
41       ;;
42
43    status)
44       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status
45       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status
46       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status
47       ;;
48
49    *)
50       echo "Usage: $0 {start|stop|restart|status}"
51       exit 1
52       ;;
53 esac
54 exit 0