]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/platforms/solaris/bacula-sd.in
Make the solaris init scripts user/group aware
[bacula/bacula] / bacula / platforms / solaris / bacula-sd.in
index fb55fb47cfd009917e53095da9bd389b640f8a95..c547697066ef80d523ae0c245113e744e1808637 100755 (executable)
@@ -4,25 +4,30 @@
 #             the bacula Storage daemon.
 #
 # chkconfig: 2345 90 9
-# description: It comes by night and sucks the vital essence from your computers.
+# description: The Leading Open Source Backup Solution.
 #
 #  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
-       RETVAL=$?
-       echo
-       [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd
+       @sbindir@/bacula-sd $2 ${SD_OPTIONS} -c @sysconfdir@/bacula-sd.conf
        ;;
     stop)
        echo "Stopping the Bacula Storage daemon: "
-#      killproc @sbindir@/bacula-sd
-       RETVAL=$?
-       echo
-       [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-sd
+       pkill -x bacula-sd
        ;;
     restart)
        $0 stop