]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/solaris/bacula-sd.in
Make the solaris init scripts user/group aware
[bacula/bacula] / bacula / platforms / solaris / bacula-sd.in
1 #! /bin/sh
2 #
3 # bacula       This shell script takes care of starting and stopping
4 #              the bacula Storage daemon.
5 #
6 # chkconfig: 2345 90 9
7 # description: The Leading Open Source Backup Solution.
8 #
9 #  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
10 #
11
12 SD_USER=@sd_user@
13 SD_GROUP=@sd_group@
14 SD_OPTIONS=''
15
16 case "$1" in
17     start)
18        if [ "${SD_USER}" != '' ]; then
19           SD_OPTIONS="${SD_OPTIONS} -u ${SD_USER}"
20        fi
21        if [ "${SD_GROUP}" != '' ]; then
22           SD_OPTIONS="${SD_OPTIONS} -g ${SD_GROUP}"
23        fi
24
25        echo "Starting the Bacula Storage daemon: "
26        @sbindir@/bacula-sd $2 ${SD_OPTIONS} -c @sysconfdir@/bacula-sd.conf
27        ;;
28     stop)
29        echo "Stopping the Bacula Storage daemon: "
30        pkill -x bacula-sd
31        ;;
32     restart)
33        $0 stop
34        sleep 5
35        $0 start
36        ;;
37     *)
38        echo "Usage: $0 {start|stop|restart}"
39        exit 1
40        ;;
41 esac
42 exit 0