summaryrefslogtreecommitdiff
blob: ab899b424690742c5628c09e440a6bfbc30f364d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/files/2.2.7/bacula-all-init,v 1.1 2007/12/29 16:21:09 wschlich Exp $

depend() {
	need net
	if [ ${LOCAL_DB} -eq 1 ]; then
		need "%database%"
	fi
	use dns
}

start() {
	local retval
	declare -i retval=0
	for s in ${SERVICES} ; do
		case ${s} in
			sd)
				ebegin "Starting bacula storage daemon"
				start-stop-daemon --start --quiet --exec /usr/sbin/bacula-sd \
					-- ${SD_OPTIONS}
				let retval+=$?
				;;
			fd)
				ebegin "Starting bacula file daemon"
				start-stop-daemon --start --quiet --exec /usr/sbin/bacula-fd \
					-- ${FD_OPTIONS}
				let retval+=$?
				;;
			dir)
				ebegin "Starting bacula director"
				start-stop-daemon --start --quiet --exec /usr/sbin/bacula-dir \
					-- ${DIR_OPTIONS}
				let retval+=$?
				;;		
			*)
				eerror "Unrecognized service found in SERVICES: '${s}'"
				;;
		esac
	done
	eend ${retval}
}

stop() {
	local retval
	declare -i retval=0
	for s in ${SERVICES} ; do
		case ${s} in
			sd)
				ebegin "Stopping bacula storage daemon"
				start-stop-daemon --stop --quiet --pidfile /var/run/bacula-sd.*.pid 
				let retval+=$?
				;;
			fd)
				ebegin "Stopping bacula file daemon"
				start-stop-daemon --stop --quiet --pidfile /var/run/bacula-fd.*.pid
				let retval+=$?
				;;
			dir)
				ebegin "Stopping bacula director"
				start-stop-daemon --stop --quiet --pidfile /var/run/bacula-dir.*.pid
				let retval+=$?
				;;		
			*)
				eerror "Unrecognized service found in SERVICES: '${s}'"
				;;
		esac
	done
	eend ${retval}
}