# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
#
+DIR_USER=@dir_user@
+DIR_GROUP=@dir_group@
+DIR_OPTIONS=''
+
RETVAL=0
case "$1" in
start)
+ if [ "${DIR_USER}" != '' ]; then
+ DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}"
+ fi
+ if [ "${DIR_GROUP}" != '' ]; then
+ DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}"
+ fi
+
echo "Starting the Bacula Director: "
- @sbindir@/bacula-dir $2 -c @sysconfdir@/bacula-dir.conf
+ @sbindir@/bacula-dir $2 ${DIR_OPTIONS} -c @sysconfdir@/bacula-dir.conf
;;
stop)
echo "Stopping the Director daemon: "
# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
#
+FD_USER=@fd_user@
+FD_GROUP=@fd_group@
+FD_OPTIONS=''
+
case "$1" in
start)
+ if [ "${FD_USER}" != '' ]; then
+ FD_OPTIONS="${FD_OPTIONS} -u ${FD_USER}"
+ fi
+ if [ "${FD_GROUP}" != '' ]; then
+ FD_OPTIONS="${FD_OPTIONS} -g ${FD_GROUP}"
+ fi
+
echo "Starting the Bacula File daemon: "
- @sbindir@/bacula-fd $2 -c @sysconfdir@/bacula-fd.conf
+ @sbindir@/bacula-fd $2 ${FD_OPTIONS} -c @sysconfdir@/bacula-fd.conf
;;
stop)
echo "Stopping the Bacula File daemon: "
# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
#
+SD_USER=@sd_user@
+SD_GROUP=@sd_group@
+SD_OPTIONS=''
+
case "$1" in
start)
+ if [ "${SD_USER}" != '' ]; then
+ SD_OPTIONS="${SD_OPTIONS} -u ${SD_USER}"
+ fi
+ if [ "${SD_GROUP}" != '' ]; then
+ SD_OPTIONS="${SD_OPTIONS} -g ${SD_GROUP}"
+ fi
+
echo "Starting the Bacula Storage daemon: "
- @sbindir@/bacula-sd $2 -c @sysconfdir@/bacula-sd.conf
+ @sbindir@/bacula-sd $2 ${SD_OPTIONS} -c @sysconfdir@/bacula-sd.conf
;;
stop)
echo "Stopping the Bacula Storage daemon: "