]> git.pld-linux.org Git - packages/bacula.git/blob - bacula-sd.init
- patch to fix a crash that may happen when using the DVD storage
[packages/bacula.git] / bacula-sd.init
1 #! /bin/sh
2 #
3 # bacula           This shell script takes care of starting and stopping
4 #                  the bacula Storage daemon.
5 #
6 # chkconfig: 2345 90 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 BACULA_SD_USER="bacula"
14 BACULA_SD_GROUP="bacula"
15 [ -f /etc/sysconfig/bacula-sd ] && . /etc/sysconfig/bacula-sd
16
17 start() {
18         # Check if the service is already running?
19         if [ ! -f /var/lock/subsys/bacula-sd ]; then
20                 msg_starting "Bacula Storage"
21                 daemon /usr/sbin/bacula-sd -u "$BACULA_SD_USER" -g "$BACULA_SD_GROUP" $2 -c /etc/bacula/bacula-sd.conf
22                 RETVAL=$?
23                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-sd
24         else
25                 msg_already_running "Bacula Storage"
26         fi
27 }
28
29 stop() {
30         if [ -f /var/lock/subsys/bacula-sd ]; then
31                 # Stop daemons.
32                 msg_stopping "Bacula Storage"
33                 killproc /usr/sbin/bacula-sd
34                 RETVAL=$?
35                 rm -f /var/lock/subsys/bacula-sd
36         else
37                 msg_not_running "Bacula Storage"
38         fi
39 }
40
41 case "$1" in
42 start)
43         start
44         ;;
45 stop)
46         stop
47         ;;
48 restart)
49         stop
50         sleep 5
51         start
52         ;;
53 status)
54         status /usr/sbin/bacula-sd
55         RETVAL=$?
56         ;;
57 *)
58         msg_usage "$0 {start|stop|restart|status}"
59         exit 3
60         ;;
61 esac
62 exit $RETVAL
This page took 0.032647 seconds and 3 git commands to generate.