Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723226 - net-analyzer/pmacct-1.7.4 /etc/init.d/pmacctd status : crashed
Summary: net-analyzer/pmacct-1.7.4 /etc/init.d/pmacctd status : crashed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-05-15 11:21 UTC by will_th
Modified: 2020-06-17 04:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description will_th 2020-05-15 11:21:29 UTC
When doing "/etc/init.d/pmacctd status" the status will be reported as crashed 
although the processes for for pmacctd are running and working.

The problem is a typo in the init script :

start() {
        checkconfig || return 1
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start \
                --pidfile "${PMACCTDPID}" \
                --exec /usr/sbin/"${SVCNAME}" \
                -- -D -f "${PMACCTDCONF}" \ -F "${PMACCTDPID}" ${OPTS}
        eend $?
}
 
produces the wrong status "crashed", because the pid would not be written to ${PMACCTDPID}.

Changing the above to  

start() {
        checkconfig || return 1
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start \
                --pidfile "${PMACCTDPID}" \
                --exec /usr/sbin/"${SVCNAME}" \
                -- -D -f "${PMACCTDCONF}" -F "${PMACCTDPID}" ${OPTS}
        eend $?
}

ommiting the "\" before -F "${PMACCTDPID}" will produce correct status output and 
the pid is written.... 

Reproducible: Always

Steps to Reproduce:
1. emerge pmacctd
2. configure 
3. runt /etc/init.d/pmacctd start
Actual Results:  
* status: crashed

Expected Results:  
* status: started
Comment 1 Larry the Git Cow gentoo-dev 2020-06-17 04:42:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e7a4cf914eb4cf0be07c35a0b6028c6929e9e14

commit 8e7a4cf914eb4cf0be07c35a0b6028c6929e9e14
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2020-06-17 04:26:47 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2020-06-17 04:42:01 +0000

    net-analyzer/pmacct: Version 1.7.4_p1
    
    Package-Manager: Portage-2.3.101, Repoman-2.3.22
    Closes: https://bugs.gentoo.org/show_bug.cgi?id=719112
    Closes: https://bugs.gentoo.org/show_bug.cgi?id=723226
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 net-analyzer/pmacct/Manifest                       |   1 +
 .../pmacct/files/pmacct-1.7.4-nDPI-3.2.patch       |  47 ++++++++++
 net-analyzer/pmacct/files/pmacctd-init.d           |   2 +-
 net-analyzer/pmacct/pmacct-1.7.4_p1.ebuild         | 103 +++++++++++++++++++++
 4 files changed, 152 insertions(+), 1 deletion(-)
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2020-06-17 04:44:22 UTC
commit d42daffe5676ab927e72a49bbe950ce511f711ef
Author: Jeroen Roovers <jer@gentoo.org>
Date:   Fri Sep 11 06:59:07 2015 +0200

    net-analyzer/pmacct: Version bump.

    Package-Manager: portage-2.2.20.1


[...]
diff --git a/net-analyzer/pmacct/files/pmacctd-init.d b/net-analyzer/pmacct/files/pmacctd-init.d
index 3a0cc734991..0c3fb905bd9 100644
--- a/net-analyzer/pmacct/files/pmacctd-init.d
+++ b/net-analyzer/pmacct/files/pmacctd-init.d
@@ -25,13 +25,17 @@ checkconfig() {
 start() {
        checkconfig || return 1
        ebegin "Starting ${SVCNAME}"
-       start-stop-daemon --start --pidfile "${PMACCTDPID}" --exec /usr/sbin/"${SVCNAME}" \
-               -- -D -f "${PMACCTDCONF}" -F "${PMACCTDPID}" ${OPTS}
+       start-stop-daemon --start \
+               --pidfile "${PMACCTDPID}" \
+               --exec /usr/sbin/"${SVCNAME}" \
+               -- -D -f "${PMACCTDCONF}" \ -F "${PMACCTDPID}" ${OPTS}
        eend $?
 }

 stop() {
        ebegin "Stopping ${SVCNAME}"
-       start-stop-daemon --stop --pidfile "${PMACCTDPID}" --exec /usr/sbin/"${SVCNAME}"
+       start-stop-daemon --stop \
+               --pidfile "${PMACCTDPID}" \
+               --exec /usr/sbin/"${SVCNAME}"
        eend $?
 }


Oops, that's been with us for a long time. Thanks for the patch!