summaryrefslogtreecommitdiffstats
path: root/main/pmacct/pmacct.initd
blob: e6e6a3f6516e0072c701d911a9c041ab445f137b (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/pmacct/files/$SVCNAME-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $

depend() {
	need net
	after firewall
}

checkconfig() {
	if [ ! -e /etc/$SVCNAME.conf ] ; then
		eerror "You need an /etc/$SVCNAME.conf file to run $SVCNAME"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting $SVCNAME"
	start-stop-daemon --start --pidfile /var/run/$SVCNAME.pid --exec /usr/sbin/$SVCNAME \
		-- -D -f /etc/$SVCNAME.conf -F /var/run/$SVCNAME.pid ${OPTS}
	eend $?
}

stop() {
	ebegin "Stopping $SVCNAME"
	start-stop-daemon --stop --pidfile /var/run/$SVCNAME.pid --exec /usr/sbin/$SVCNAME
	eend $?
}