]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/slackware/rc.bacula-sd.in
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / bacula / platforms / slackware / rc.bacula-sd.in
1 #! /bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # bacula       This shell script takes care of starting and stopping
7 #              the bacula Storage daemon.
8 #
9 # chkconfig: 2345 90 99
10 # description: The Leading Open Source Backup Solution.
11 #
12 #  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
13 #
14
15 # Source function library
16 . /etc/rc.d/functions.bacula
17
18 RETVAL=0
19 case "$1" in
20     start)
21         [ -x ${BACSDBIN}/bacula-sd ] && { 
22             sleep 2
23             echo -n "Starting the Storage daemon: "
24             OPTIONS=''
25             if [ "${SD_USER}" != '' ]; then
26                OPTIONS="${OPTIONS} -u ${SD_USER}"
27             fi
28
29             if [ "${SD_GROUP}" != '' ]; then
30                OPTIONS="${OPTIONS} -g ${SD_GROUP}"
31             fi
32
33             ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf
34             RETVAL=$?
35             echo Done.
36         }
37         ;;
38     stop)
39         [ -x ${BACSDBIN}/bacula-sd ] && {
40             echo -n "Stopping the Storage daemon: "
41             killproc ${BACSDBIN}/bacula-sd ${SD_PORT}
42             RETVAL=$?
43             echo Done.
44         }
45         ;;
46     restart)
47         $0 stop
48         sleep 5
49         $0 start
50         RETVAL=$?
51         ;;
52     status)
53         [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT}
54         RETVAL=$?
55         ;;
56     *)
57         echo "Usage: $0 {start|stop|restart|status}"
58         exit 1
59         ;;
60 esac
61 exit $RETVAL