]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/platforms/solaris/bacula-fd.in
Cleanup Solaris init scripts and made them zone aware.
[bacula/bacula] / bacula / platforms / solaris / bacula-fd.in
index eeca38d537bf9b7421083e76ed0d9ed77f7c2a55..a9eb2044b151831b6169697183dbb6e976118e61 100755 (executable)
@@ -1,12 +1,11 @@
-#! /bin/sh
+#!/bin/sh
 #
 # bacula       This shell script takes care of starting and stopping
 #             the bacula File daemon.
 #
-# chkconfig: 2345 91 9
 # description: The Leading Open Source Backup Solution.
 #
-#  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
+# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
 #
 
 FD_USER=@fd_user@
@@ -15,11 +14,13 @@ FD_OPTIONS=''
 
 case "$1" in
     start)
-       if [ "${FD_USER}" != '' ]; then
-          FD_OPTIONS="${FD_OPTIONS} -u ${FD_USER}"
+       if [ ! -z "${DIR_USER}" ]; then
+          [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \
+                                     DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}"
        fi
-       if [ "${FD_GROUP}" != '' ]; then
-          FD_OPTIONS="${FD_OPTIONS} -g ${FD_GROUP}"
+       if [ ! -z "${DIR_GROUP}" ]; then
+          [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \
+                                     DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}"
        fi
 
        echo "Starting the Bacula File daemon: "
@@ -27,7 +28,18 @@ case "$1" in
        ;;
     stop)
        echo "Stopping the Bacula File daemon: "
-       pkill -x bacula-fd
+       if [ -x /usr/bin/zonename ]; then
+          case `/usr/bin/zonename` in
+             global)
+                pkill -z global -x bacula-fd
+                ;;
+             *)
+                pkill -x bacula-fd
+                ;;
+          esac
+       else
+          pkill -x bacula-fd
+       fi
        ;;
     restart)
        $0 stop