3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # bacula This shell script takes care of starting and stopping
7 # the bacula File daemon.
10 # description: The Leading Open Source Backup Solution.
12 # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
15 # Source function library
16 . /etc/rc.d/init.d/functions
25 # if /lib/tls exists, force Bacula to use the glibc pthreads instead
26 if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then
27 export LD_ASSUME_KERNEL=2.4.19
30 # pull in any user defined FD_OPTIONS, FD_USER, FD_GROUP
31 [ -f /etc/sysconfig/bacula ] && . /etc/sysconfig/bacula
34 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
42 if [ "${FD_USER}" != '' ]; then
43 FD_OPTIONS="${FD_OPTIONS} -u ${FD_USER}"
46 if [ "${FD_GROUP}" != '' ]; then
47 FD_OPTIONS="${FD_OPTIONS} -g ${FD_GROUP}"
50 if [ "${DAEMON_USER}" != '' -a "${FD_USER}" != '' ]; then
52 if [ "${FD_GROUP}" != '' ]; then
53 chown ${FD_USER}:${FD_GROUP} @working_dir@/bacula-fd* 2> /dev/null
55 chown ${FD_USER} @working_dir@/bacula-fd* 2> /dev/null
57 DAEMON_OPTIONS="--user ${FD_USER}"
60 echo -n "Starting Bacula File services: "
61 daemon ${DAEMON_OPTIONS} @sbindir@/bacula-fd $2 ${FD_OPTIONS} -c @sysconfdir@/bacula-fd.conf
64 [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd
67 echo -n "Stopping Bacula File services: "
68 killproc @sbindir@/bacula-fd
71 [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-fd
80 status @sbindir@/bacula-fd
84 echo "Usage: $0 {start|stop|restart|status}"