]> git.sur5r.net Git - bacula/bacula/commitdiff
Make the solaris init scripts user/group aware
authorBen Walton <bwalton@artsci.utoronto.ca>
Fri, 29 Apr 2011 15:53:45 +0000 (11:53 -0400)
committerMarco van Wieringen <mvw@planets.elm.net>
Sun, 1 May 2011 15:11:48 +0000 (17:11 +0200)
Import the values for the user and group settings specified by
configure when generating the solaris init scripts.  Use these values
for the -u and -g parameters when starting the daemons.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
bacula/platforms/solaris/bacula-dir.in
bacula/platforms/solaris/bacula-fd.in
bacula/platforms/solaris/bacula-sd.in

index f34e672bcb3a77ffee4b7ff775ef4907802cc276..c5a3a93c32f3b25df50c87b5a706c6d31362e909 100755 (executable)
@@ -9,11 +9,22 @@
 #  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: "
index cd3bef1a37331e3ee8d0da31087fdecb8765a9eb..eeca38d537bf9b7421083e76ed0d9ed77f7c2a55 100755 (executable)
@@ -9,10 +9,21 @@
 #  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: "
index 6a0adb80a96e3696f927e03f7dd1d04b17e79e2f..c547697066ef80d523ae0c245113e744e1808637 100755 (executable)
@@ -9,10 +9,21 @@
 #  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: "