]> git.pld-linux.org Git - packages/bacula.git/blob - bacula-dir.init
- %{version} removed from other library names
[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         # Check if the service is already running?
15         if [ ! -f /var/lock/subsys/bacula-dir ]; then
16                 msg_starting "Bacula Director"
17                 daemon /usr/sbin/bacula-dir -u bacula -g bacula $2 -c /etc/bacula/bacula-dir.conf
18                 RETVAL=$?
19                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-dir
20         else
21                 msg_already_running "Bacula Director"
22         fi
23 }
24
25 stop() {
26         if [ -f /var/lock/subsys/bacula-dir ]; then
27                 # Stop daemons.
28                 msg_stopping "Bacula Director"
29                 killproc /usr/sbin/bacula-dir
30                 RETVAL=$?
31                 rm -f /var/lock/subsys/bacula-dir
32         else
33                 msg_not_running "Bacula Director"
34         fi
35 }
36
37 RETVAL=0
38 case "$1" in
39 start)
40         start
41         ;;
42 stop)
43         stop
44         ;;
45 restart)
46         stop
47         sleep 5
48         start
49         ;;
50 status)
51         status /usr/sbin/bacula-dir
52         RETVAL=$?
53         ;;
54 *)
55         msg_usage "$0 {start|stop|restart|status}"
56         exit 3
57         ;;
58 esac
59 exit $RETVAL
This page took 0.038962 seconds and 3 git commands to generate.