Gentoo Archives: gentoo-commits

From: "Jeroen Roovers (jer)" <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/pmacct/files: pmacctd-init.d
Date: Thu, 30 Sep 2010 16:43:09
Message-Id: 20100930164305.275EB2003C@flycatcher.gentoo.org
1 jer 10/09/30 16:43:05
2
3 Modified: pmacctd-init.d
4 Log:
5 Version bump thanks to Marcin Mirosław (bug #339229). Change init.d script to allow multiple instances by Marcin Mirosław (bug #306837).
6
7 (Portage version: 2.2_rc86/cvs/Linux i686)
8
9 Revision Changes Path
10 1.5 net-analyzer/pmacct/files/pmacctd-init.d
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d?rev=1.5&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d?rev=1.5&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d?r1=1.4&r2=1.5
15
16 Index: pmacctd-init.d
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d,v
19 retrieving revision 1.4
20 retrieving revision 1.5
21 diff -u -r1.4 -r1.5
22 --- pmacctd-init.d 1 Jun 2009 09:48:41 -0000 1.4
23 +++ pmacctd-init.d 30 Sep 2010 16:43:05 -0000 1.5
24 @@ -1,29 +1,37 @@
25 #!/sbin/runscript
26 -# Copyright 1999-2004 Gentoo Foundation
27 +# Copyright 1999-2010 Gentoo Foundation
28 # Distributed under the terms of the GNU General Public License v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pmacct/files/pmacctd-init.d,v 1.5 2010/09/30 16:43:05 jer Exp $
31 +
32 +PMACCTDDIR=${PMACCTDDIR:-/etc/pmacct}
33 +if [ ${SVCNAME} != "pmacctd" ]; then
34 + PMACCTDPID="/var/run/${SVCNAME}.pid"
35 +else
36 + PMACCTDPID="/var/run/pmacctd.pid"
37 +fi
38 +PMACCTDCONF="${PMACCTDDIR}/${SVCNAME}.conf"
39
40 depend() {
41 need net
42 }
43
44 checkconfig() {
45 - if [ ! -e /etc/pmacctd.conf ] ; then
46 - eerror "You need an /etc/pmacctd.conf file to run pmacctd"
47 + if [ ! -e ${PMACCTDCONF} ] ; then
48 + eerror "You need an ${PMACCTDCONF} file to run pmacctd"
49 return 1
50 fi
51 }
52
53 start() {
54 checkconfig || return 1
55 - ebegin "Starting pmacctd"
56 - start-stop-daemon --start --pidfile /var/run/pmacctd.pid --exec /usr/sbin/pmacctd \
57 - -- -D -f /etc/pmacctd.conf -F /var/run/pmacctd.pid ${OPTS}
58 + ebegin "Starting ${SVCNAME}"
59 + start-stop-daemon --start --pidfile "${PMACCTDPID}" --exec /usr/sbin/pmacctd \
60 + -- -D -f "${PMACCTDCONF}" -F "${PMACCTDPID}" ${OPTS}
61 eend $?
62 }
63
64 stop() {
65 - ebegin "Stopping pmacctd"
66 - start-stop-daemon --stop --pidfile /var/run/pmacctd.pid --exec /usr/sbin/pmacctd
67 + ebegin "Stopping ${SVCNAME}"
68 + start-stop-daemon --stop --pidfile "${PMACCTDPID}" --exec /usr/sbin/pmacctd
69 eend $?
70 }