Bug#788851: acct: Sometimes new acct records not written after cron.daily/savelog

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#788851: acct: Sometimes new acct records not written after cron.daily/savelog

Dominique Brazziel
Package: acct
Version: 6.5.5-2.1
Severity: normal
Tags: patch

    Occasionally the accounting subsystem doesn not begin
writing to the new account file ('/var/log/accout/pacct')
after the savelog is done in '/etc/cron.daily/acct'.  
I had observed this phenomena on Fedora systems and
recently saw it in Debian.  One of the symptoms was that
new accounting records continued to be written to the
previous accounting file, which is now 'pacct.0', so the
cause may be the kernel having an open file handle.

    Attached is a patch to keep restarting the acct service
until it is observed that the new accounting file increases
in size.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.16.7-ckt11-1-inter04-686-pae (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages acct depends on:
ii  dpkg          1.18.1
ii  install-info  5.2.0.dfsg.1-6
ii  libc6         2.19-18

acct recommends no packages.

acct suggests no packages.

-- Configuration Files:
/etc/cron.daily/acct changed:
test -x /usr/sbin/accton || exit 0
if [ -f /etc/default/acct ]
then
        . /etc/default/acct
else
        ACCT_LOGGING="30"
fi
cd /var/log/account
savelog -g adm -m 0640 -u root -c "${ACCT_LOGGING}" /var/log/account/pacct > /dev/null
    ACCTSIZE=$(ls -l /var/log/account/pacct | awk '{print $5}')
    while [ $ACCTSIZE -eq 0  ];do
        invoke-rc.d acct restart > /dev/null
        ACCTSIZE=$(ls -l /var/log/account/pacct | awk '{print $5}')
    done
fi
exit 0


-- no debconf information

acct.cron.daily.patch (819 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#788851: Patch for acct

Marcos Fouces-2
Hello Dominique

Thanks for your report.

I also believe that is not a acct bug as you admit ("...so the cause may
be the kernel having an open file handle.")

BTW. i cannot reproduce this bug myself. Could you please check if the
problem persist with a newer kernel?

If no more info is provided i eventually close this bug.

Greetints,

Marcos.