summaryrefslogtreecommitdiff
blob: 73df1d16527f04b960614861081933dc9d87a08b (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
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
	use logger net
	before mta
}

checkconfig() {
	if [ ! -r "${CONF_FILE}" ]
	then
		eerror "You need a gross configuration file in ${CONF_FILE}"
		return 1
	fi
	/usr/sbin/grossd -C -f "${CONF_FILE}" >/dev/null 2>&1
	return
}

start() {
	checkconfig || return 1
	ebegin "Starting ${SVCNAME}"
	start-stop-daemon \
		--start \
		--name grossd \
		--pid "${GROSS_PID}" \
		--exec /usr/sbin/grossd -- -P ${GROSS_PID} -f "${CONF_FILE}" ${GROSSD_OPTS}
	eend ${?} "Failed to start ${SVCNAME}"
}

stop() {
	ebegin "Shutting down ${SVCNAME}"
	start-stop-daemon \
		--stop \
		--quiet \
		--name grossd \
		--pidfile "${GROSS_PID}"
	eend ${?} "Failed to stop ${SVCNAME}"
}