]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula-fd.in
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / platforms / redhat / bacula-fd.in
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 9
7 # description: It comes by night and sucks the vital essence from your computers.
8 #
9 #  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
10 #
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 FD_USER=@fd_user@
16 FD_GROUP=@fd_group@
17 FD_OPTIONS=''
18 OS=`uname -s`
19
20 # if /lib/tls exists, force Bacula to use the glibc pthreads instead
21 if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then
22      export LD_ASSUME_KERNEL=2.4.19
23 fi
24
25 # pull in any user defined FD_OPTIONS, FD_USER, FD_GROUP 
26 [ -f /etc/sysconfig/bacula ] && . /etc/sysconfig/bacula
27
28 RETVAL=0
29 case "$1" in
30     start)
31        if [ "${FD_USER}" != '' ]; then
32           FD_OPTIONS="${FD_OPTIONS} -u ${FD_USER}"
33        fi
34                                                                                    
35        if [ "${FD_GROUP}" != '' ]; then
36           FD_OPTIONS="${FD_OPTIONS} -g ${FD_GROUP}"
37        fi
38        echo -n "Starting Bacula File services: "
39        daemon @sbindir@/bacula-fd $2 ${FD_OPTIONS} -c @sysconfdir@/bacula-fd.conf
40        RETVAL=$?
41        echo
42        [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd
43        ;;
44     stop)
45        echo -n "Stopping Bacula File services: "
46        killproc @sbindir@/bacula-fd
47        RETVAL=$?
48        echo
49        [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-fd
50        ;;
51     restart)
52        $0 stop
53        sleep 5
54        $0 start
55        ;;
56     status)
57        status @sbindir@/bacula-fd
58        ;;
59     *)
60        echo "Usage: $0 {start|stop|restart|status}"
61        exit 1
62        ;;
63 esac
64 exit 0