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 Storage 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 SD_OPTIONS, SD_USER, SD_GROUP or DAEMON_USER
31 [ -f /etc/sysconfig/bacula ] && . /etc/sysconfig/bacula
34 # Disable Glibc malloc checks, it doesn't help and it keeps from getting
42 if [ "${SD_USER}" != '' ]; then
43 SD_OPTIONS="${SD_OPTIONS} -u ${SD_USER}"
46 if [ "${SD_GROUP}" != '' ]; then
47 SD_OPTIONS="${SD_OPTIONS} -g ${SD_GROUP}"
50 if [ "${DAEMON_USER}" != '' -a "${SD_USER}" != '' ]; then
52 if [ "${SD_GROUP}" != '' ]; then
53 chown ${SD_USER}:${SD_GROUP} @working_dir@/bacula-sd* 2> /dev/null
55 chown ${SD_USER} @working_dir@/bacula-sd* 2> /dev/null
57 DAEMON_OPTIONS="--user ${SD_USER}"
60 echo -n "Starting Bacula Storage services: "
61 daemon $DAEMON_OPTIONS @sbindir@/bacula-sd $2 ${SD_OPTIONS} -c @sysconfdir@/bacula-sd.conf
64 [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd
67 echo -n "Stopping Bacula Storage services: "
68 killproc @sbindir@/bacula-sd
71 [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-sd
80 status @sbindir@/bacula-sd
84 echo "Usage: $0 {start|stop|restart|status}"