]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/bacula.in
baculum: Use home page url when an error is shown
[bacula/bacula] / bacula / scripts / bacula.in
1 #! /bin/sh
2 #
3 #   Bacula(R) - The Network Backup Solution
4 #
5 #   Copyright (C) 2000-2016 Kern Sibbald
6 #
7 #   The original author of Bacula is Kern Sibbald, with contributions
8 #   from many others, a complete list can be found in the file AUTHORS.
9 #
10 #   You may use this file and others of this release according to the
11 #   license defined in the LICENSE file, which includes the Affero General
12 #   Public License, v3.0 ("AGPLv3") and some additional permissions and
13 #   terms pursuant to its AGPLv3 Section 7.
14 #
15 #   This notice must be preserved when any source code is 
16 #   conveyed and/or propagated.
17 #
18 #   Bacula(R) is a registered trademark of Kern Sibbald.
19 #
20 # bacula       This shell script takes care of starting and stopping
21 #              the bacula daemons.
22 #
23 #   This is pretty much watered down version of the RedHat script
24 #   that works on Solaris as well as Linux, but it won't work everywhere.
25 #
26 # description: The Leading Open Source Backup Solution.
27 #
28
29 # All these are not *really* needed but it makes it
30 #  easier to "steal" this code for the development 
31 #  environment where they are different.
32 #  
33 SCRIPTDIR=@scriptdir@
34 #
35 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
36 #   good dumps
37 MALLOC_CHECK_=0
38 export MALLOC_CHECK_
39
40 case "$1" in
41    start)
42       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
43       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
44       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2
45       ;;
46
47    stop)
48       # Stop the FD first so that SD will fail jobs and update catalog
49       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
50       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
51       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2
52       ;;
53
54    restart)
55       $0 stop
56       sleep 2
57       $0 start
58       ;;
59
60    status)
61       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status
62       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status
63       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status
64       ;;
65
66    *)
67       echo "Usage: $0 {start|stop|restart|status}"
68       exit 1
69       ;;
70 esac
71 exit 0