]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula-fd.in
Allow use of /lib/tls on 2.6 kernels
[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 OS=`uname -s`
18
19 # if /lib/tls exists, force Bacula to use the glibc pthreads instead
20 if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then
21      export LD_ASSUME_KERNEL=2.4.19
22 fi
23 RETVAL=0
24 case "$1" in
25     start)
26        OPTIONS=''
27        if [ "${FD_USER}" != '' ]; then
28           OPTIONS="${OPTIONS} -u ${FD_USER}"
29        fi
30                                                                                    
31        if [ "${FD_GROUP}" != '' ]; then
32           OPTIONS="${OPTIONS} -g ${FD_GROUP}"
33        fi
34        echo -n "Starting Bacula File services: "
35        daemon @sbindir@/bacula-fd $2 ${OPTIONS} -c @sysconfdir@/bacula-fd.conf
36        RETVAL=$?
37        echo
38        [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd
39        ;;
40     stop)
41        echo -n "Stopping Bacula File services: "
42        killproc @sbindir@/bacula-fd
43        RETVAL=$?
44        echo
45        [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-fd
46        ;;
47     restart)
48        $0 stop
49        sleep 5
50        $0 start
51        ;;
52     status)
53        status @sbindir@/bacula-fd
54        ;;
55     *)
56        echo "Usage: $0 {start|stop|restart|status}"
57        exit 1
58        ;;
59 esac
60 exit 0