Lines 1-29
Link Here
|
1 |
#!/sbin/runscript |
1 |
#!/sbin/runscript |
2 |
# Copyright 1999-2004 Gentoo Foundation |
2 |
# Copyright 1999-2010 Gentoo Foundation |
3 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $ |
4 |
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $ |
5 |
|
5 |
|
|
|
6 |
PMACCTDDIR=${PMACCTDDIR:-/etc/pmacct} |
7 |
if [ ${SVCNAME} != "pmacctd" ]; then |
8 |
PMACCTDPID="/var/run/${SVCNAME}.pid" |
9 |
else |
10 |
PMACCTDPID="/var/run/pmacctd.pid" |
11 |
fi |
12 |
PMACCTDCONF="${PMACCTDDIR}/${SVCNAME}.conf" |
13 |
|
6 |
depend() { |
14 |
depend() { |
7 |
need net |
15 |
need net |
8 |
} |
16 |
} |
9 |
|
17 |
|
10 |
checkconfig() { |
18 |
checkconfig() { |
11 |
if [ ! -e /etc/pmacctd.conf ] ; then |
19 |
if [ ! -e ${PMACCTDCONF} ] ; then |
12 |
eerror "You need an /etc/pmacctd.conf file to run pmacctd" |
20 |
eerror "You need an ${PMACCTDCONF} file to run pmacctd" |
13 |
return 1 |
21 |
return 1 |
14 |
fi |
22 |
fi |
15 |
} |
23 |
} |
16 |
|
24 |
|
17 |
start() { |
25 |
start() { |
18 |
checkconfig || return 1 |
26 |
checkconfig || return 1 |
19 |
ebegin "Starting pmacctd" |
27 |
ebegin "Starting ${SVCNAME}" |
20 |
start-stop-daemon --start --pidfile /var/run/pmacctd.pid --exec /usr/sbin/pmacctd \ |
28 |
start-stop-daemon --start --pidfile "${PMACCTDPID}" --exec /usr/sbin/pmacctd \ |
21 |
-- -D -f /etc/pmacctd.conf -F /var/run/pmacctd.pid ${OPTS} |
29 |
-- -D -f "${PMACCTDCONF}" -F "${PMACCTDPID}" ${OPTS} |
22 |
eend $? |
30 |
eend $? |
23 |
} |
31 |
} |
24 |
|
32 |
|
25 |
stop() { |
33 |
stop() { |
26 |
ebegin "Stopping pmacctd" |
34 |
ebegin "Stopping ${SVCNAME}" |
27 |
start-stop-daemon --stop --pidfile /var/run/pmacctd.pid --exec /usr/sbin/pmacctd |
35 |
start-stop-daemon --stop --pidfile "${PMACCTDPID}" --exec /usr/sbin/pmacctd |
28 |
eend $? |
36 |
eend $? |
29 |
} |
37 |
} |