LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   PATCH: Slackware64 14.1rc1 - acct package (https://www.linuxquestions.org/questions/slackware-14/patch-slackware64-14-1rc1-acct-package-4175481909/)

ktreadway 10-23-2013 04:47 PM

PATCH: Slackware64 14.1rc1 - acct package
 
I found an issue in the 'acct' package in Slackware64 14 and it still exists in 14.1rc1. I sent this to Pat a few months ago, but I'm sure he stays plenty busy. Perhaps someone can help both of us out. :)

The problem is that output from the 'sa' process accounting utility only reports 'inf' and '-nan' in the output instead of the correct numbers/statistics.

Example (unpatched, top 4):
Code:

/usr/bin/sa --user-summary
                                    38998      -nanre      -nancp  -nanavio      3705k
root                                28768      -nanre      -nancp  -nanavio      2418k
dovenull                            2716        infre      -nancp  -nanavio      5536k
vmail                                2695        infre      -nancp  -nanavio      7845k

Example (patched, top 4):
Code:

/usr/bin/sa --user-summary
                                    39607  59486.72re      72.41cp      0avio      3680k
root                                29372  17591.60re      52.47cp  0avio      2411k
clamav                                208  22994.61re      19.32cp  0avio    13524k
dovenull                            2716      50.70re      0.36cp  0avio      5536k

To reproduce:
1) Enable process accounting. (touch /var/log/pacct && chmod 640 /var/log/pacct && /sbin/accton /var/log/pacct)
2) Run a few commands to be logged.
3) Run a report. (/usr/bin/sa --user-summary)

The Debian folks fixed the issue and have released a patch for 6.5.4. I put it and the SlackBuild change into the linked patch file.

If anyone needs reference to the original Debian patch, you can find it here: http://patch-tracker.debian.org/package/acct/6.5.4-2.1 (It's the '581421-sa-hz-division.patch' one.)

Here's the patch: https://www.dropbox.com/s/rkgvnatrwe...rrent.patch.gz

Ken

mancha 10-23-2013 05:10 PM

BTW, Seems these problems have been fixed in acct-6.6.1.

This requires a slightly different acct.logdir.fhs.diff:

Code:

--- ./configure.ac.orig 2013-10-23
+++ ./configure.ac      2013-10-23
@@ -259,7 +259,7 @@
 #ifndef ACCT_FILE
 #  if defined(__FreeBSD__) || defined(__linux__) \
        || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define ACCT_FILE "/var/log/account/pacct"
+#    define ACCT_FILE "/var/log/pacct"
 #  else
 #    if defined(__NetBSD__)
 #      define ACCT_FILE "/var/log/account/acct"
@@ -280,7 +280,7 @@
 #ifndef SAVACCT_FILE
 #  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
        || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define SAVACCT_FILE "/var/log/account/savacct"
+#    define SAVACCT_FILE "/var/log/savacct"
 #  else
 #    if defined(sun) || defined(AMIX)
 #      define SAVACCT_FILE "/var/adm/savacct"
@@ -297,7 +297,7 @@
 #ifndef USRACCT_FILE
 #  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
        || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define USRACCT_FILE "/var/log/account/usracct"
+#    define USRACCT_FILE "/var/log/usracct"
 #  else
 #    if defined(sun) || defined(AMIX)
 #      define USRACCT_FILE "/var/adm/usracct"

--mancha

ktreadway 10-23-2013 06:38 PM

That could be why we still have the older version. More interested in fixing the existing issue rather than debating a last minute update! :)

volkerdi 10-23-2013 07:04 PM

The acct-6.6.1 release was screwed up and the tarball is filled with cruft. And it looks like those who have taken it have had to patch against crashes and other bugs.

I'll take a look at the patch.

mancha 10-23-2013 11:37 PM

I see. Pity it's not well-maintained.

--mancha


All times are GMT -5. The time now is 12:10 PM.