]> git.pld-linux.org Git - packages/bacula.git/blob - bacula-dir.init
- use functions
[packages/bacula.git] / bacula-dir.init
1 #!/bin/sh
2 #
3 # bacula           This shell script takes care of starting and stopping
4 #                  the bacula Director daemon
5 #
6 # chkconfig: 2345 92 99
7 # description: It comes by night and sucks the vital essence from your computers.
8 #
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 start() {
14         msg_starting "Bacula Director"
15         daemon /usr/sbin/bacula-dir -u bacula -g bacula $2 -c /etc/bacula/bacula-dir.conf
16         RETVAL=$?
17         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-dir
18 }
19
20 stop() {
21         msg_stopping "Bacula Director"
22         killproc /usr/sbin/bacula-dir
23         RETVAL=$?
24         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-dir
25 }
26
27 RETVAL=0
28 case "$1" in
29 start)
30         start
31         ;;
32 stop)
33         stop
34         ;;
35 restart)
36         stop
37         sleep 5
38         start
39         ;;
40 status)
41         status /usr/sbin/bacula-dir
42         RETVAL=$?
43         ;;
44 *)
45         echo "Usage: $0 {start|stop|restart|status}"
46         exit 1
47         ;;
48 esac
49 exit $RETVAL
This page took 0.074993 seconds and 4 git commands to generate.