- echo "Starting the Storage daemon"
- @sbindir@/bacula-sd $2 -v -c @sysconfdir@/bacula-sd.conf
- echo "Starting the File daemon"
- @sbindir@/bacula-fd $2 -v -c @sysconfdir@/bacula-fd.conf
- sleep 2
- echo "Starting the Director daemon"
- @sbindir@/bacula-dir $2 -v -c @sysconfdir@/bacula-dir.conf
+ [ -x ${BACSDBIN}/bacula-sd ] && {
+ echo "Starting the Storage daemon"
+ OPTIONS=''
+ if [ "${SD_USER}" != '' ]; then
+ OPTIONS="${OPTIONS} -u ${SD_USER}"
+ fi
+
+ if [ "${SD_GROUP}" != '' ]; then
+ OPTIONS="${OPTIONS} -g ${SD_GROUP}"
+ fi
+
+ ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf
+ }
+
+ [ -x ${BACFDBIN}/bacula-fd ] && {
+ echo "Starting the File daemon"
+ OPTIONS=''
+ if [ "${FD_USER}" != '' ]; then
+ OPTIONS="${OPTIONS} -u ${FD_USER}"
+ fi
+
+ if [ "${FD_GROUP}" != '' ]; then
+ OPTIONS="${OPTIONS} -g ${FD_GROUP}"
+ fi
+
+ ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf
+ }
+
+ [ -x ${BACDIRBIN}/bacula-dir ] && {
+ sleep 2
+ echo "Starting the Director daemon"
+ OPTIONS=''
+ if [ "${DIR_USER}" != '' ]; then
+ OPTIONS="${OPTIONS} -u ${DIR_USER}"
+ fi
+
+ if [ "${DIR_GROUP}" != '' ]; then
+ OPTIONS="${OPTIONS} -g ${DIR_GROUP}"
+ fi
+
+ ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
+ }