]>
Commit | Line | Data |
---|---|---|
cdaeb249 AM |
1 | #! /bin/sh |
2 | # | |
3 | # bacula This shell script takes care of starting and stopping | |
4 | # the bacula File daemon. | |
5 | # | |
6 | # chkconfig: 2345 91 99 | |
7 | # description: It comes by night and sucks the vital essence from your computers. | |
8 | # | |
cdaeb249 AM |
9 | |
10 | # Source function library | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
e0e7a497 JK |
13 | BACULA_FD_USER="bacula" |
14 | BACULA_FD_GROUP="bacula" | |
15 | [ -f /etc/sysconfig/bacula-fd ] && . /etc/sysconfig/bacula-fd | |
16 | ||
17 | ||
cdaeb249 AM |
18 | case "$1" in |
19 | start) | |
4e9f846d | 20 | msg_starting "Bacula File" |
e0e7a497 | 21 | daemon /usr/sbin/bacula-fd -u "$BACULA_FD_USER" -g "$BACULA_FD_GROUP" $2 -c /etc/bacula/bacula-fd.conf |
cdaeb249 | 22 | RETVAL=$? |
3577ad38 | 23 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-fd |
cdaeb249 AM |
24 | ;; |
25 | stop) | |
4e9f846d | 26 | msg_stopping "Bacula File" |
3577ad38 | 27 | killproc /usr/sbin/bacula-fd |
cdaeb249 | 28 | RETVAL=$? |
3577ad38 | 29 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-fd |
cdaeb249 AM |
30 | ;; |
31 | restart) | |
3577ad38 | 32 | $0 stop && sleep 5 |
cdaeb249 | 33 | $0 start |
3577ad38 | 34 | RETVAL=$? |
cdaeb249 AM |
35 | ;; |
36 | status) | |
3577ad38 | 37 | status /usr/sbin/bacula-fd |
a5892fae | 38 | RETVAL=$? |
cdaeb249 AM |
39 | ;; |
40 | *) | |
41 | echo "Usage: $0 {start|stop|restart|status}" | |
42 | exit 1 | |
43 | ;; | |
44 | esac | |
3577ad38 | 45 | exit $RETVAL |