]> git.pld-linux.org Git - packages/bacula.git/blame - bacula-sd.init
- $2 does not get passed to startup opts, use sysconfig instead
[packages/bacula.git] / bacula-sd.init
CommitLineData
ff0cb478 1#!/bin/sh
cdaeb249 2#
197639d6
ER
3# bacula This shell script takes care of starting and stopping
4# the bacula Storage daemon.
cdaeb249 5#
ff0cb478 6# chkconfig: 2345 90 10
cdaeb249
AM
7# description: It comes by night and sucks the vital essence from your computers.
8#
cdaeb249
AM
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
e0e7a497
JK
13BACULA_SD_USER="bacula"
14BACULA_SD_GROUP="bacula"
85bf6ecd 15BACULA_SD_OPTIONS=""
7193cf57 16[ -f /etc/sysconfig/bacula-sd ] && . /etc/sysconfig/bacula-sd
e0e7a497 17
aba6a208 18start() {
887794d3 19 # Check if the service is already running?
c6fcce82 20 if [ -f /var/lock/subsys/bacula-sd ]; then
887794d3 21 msg_already_running "Bacula Storage"
c6fcce82 22 return
887794d3 23 fi
c6fcce82
ER
24
25 msg_starting "Bacula Storage"
85bf6ecd 26 daemon /usr/sbin/bacula-sd -u "$BACULA_SD_USER" -g "$BACULA_SD_GROUP" -c /etc/bacula/bacula-sd.conf $BACULA_SD_OPTIONS
c6fcce82
ER
27 RETVAL=$?
28 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bacula-sd
aba6a208
ER
29}
30
31stop() {
c6fcce82 32 if [ ! -f /var/lock/subsys/bacula-sd ]; then
887794d3 33 msg_not_running "Bacula Storage"
c6fcce82 34 return
887794d3 35 fi
c6fcce82
ER
36
37 # Stop daemons.
38 msg_stopping "Bacula Storage"
39 killproc /usr/sbin/bacula-sd
40 RETVAL=$?
41 rm -f /var/lock/subsys/bacula-sd
aba6a208
ER
42}
43
44case "$1" in
45start)
46 start
47 ;;
48stop)
49 stop
197639d6
ER
50 ;;
51restart)
aba6a208
ER
52 stop
53 sleep 5
54 start
197639d6
ER
55 ;;
56status)
57 status /usr/sbin/bacula-sd
58 RETVAL=$?
59 ;;
60*)
887794d3
ER
61 msg_usage "$0 {start|stop|restart|status}"
62 exit 3
197639d6 63 ;;
cdaeb249 64esac
3577ad38 65exit $RETVAL
This page took 0.125587 seconds and 4 git commands to generate.