]>
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 | ||
13 | case "$1" in | |
14 | start) | |
3577ad38 AM |
15 | msg_starting "Bacula File daemon" |
16 | daemon /usr/sbin/bacula-fd $2 -c /etc/bacula/bacula-fd.conf | |
cdaeb249 | 17 | RETVAL=$? |
3577ad38 | 18 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-fd |
cdaeb249 AM |
19 | ;; |
20 | stop) | |
3577ad38 AM |
21 | msg_stopping "Bacula File daemon" |
22 | killproc /usr/sbin/bacula-fd | |
cdaeb249 AM |
23 | RETVAL=$? |
24 | echo | |
3577ad38 | 25 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-fd |
cdaeb249 AM |
26 | ;; |
27 | restart) | |
3577ad38 | 28 | $0 stop && sleep 5 |
cdaeb249 | 29 | $0 start |
3577ad38 | 30 | RETVAL=$? |
cdaeb249 AM |
31 | ;; |
32 | status) | |
3577ad38 | 33 | status /usr/sbin/bacula-fd |
cdaeb249 AM |
34 | ;; |
35 | *) | |
36 | echo "Usage: $0 {start|stop|restart|status}" | |
37 | exit 1 | |
38 | ;; | |
39 | esac | |
3577ad38 | 40 | exit $RETVAL |