#922533 please document location of accounting file

Package:
acct
Source:
acct
Description:
GNU Accounting utilities for process and login accounting
Submitter:
Marc Haber
Date:
2025-09-03 20:37:04 UTC
Severity:
wishlist
Tags:
#922533#5
Date:
2019-02-17 19:50:35 UTC
From:
To:
Hi,

my package atop needs to adapt itself to acct being installed or not. If
acct is installed, atop reads from acct's log files, while establishing
its own accounting interface it acct is not installed.

Historically, the pacct file is found in various different places,
varying across distribution, so atop's upstream code does through
various contortions to find the correct file. It for example acts on
/etc/logrotate.d/psacct to find the file being rotated, which fails on
Debian since Debian's acct package uses savelog in /etc/cron.d/acct.

atop on Debian is currently growing code to parse for the savelog line
in /etc/cron.d/acct to find out the acct file being used.

Would it be possible ot have the acct file's location in a more easily
parsable location? Thanks for helping!

Greetings
Marc

#922533#10
Date:
2019-02-19 22:44:39 UTC
From:
To:
Hi Marc

In Debian, the pacct file is located in /var/log/account/pacct while in
Fedora it is in /var/account/pacct.

I don't see the reason to be less parsable in that location.

What is your suggestion?

Greetings,

Marcos

#922533#15
Date:
2019-02-19 22:44:39 UTC
From:
To:
Hi Marc

In Debian, the pacct file is located in /var/log/account/pacct while in
Fedora it is in /var/account/pacct.

I don't see the reason to be less parsable in that location.

What is your suggestion?

Greetings,

Marcos

#922533#20
Date:
2019-02-20 16:46:41 UTC
From:
To:
Hi Marcos,

thanks for your answer.

My suggestion is to have a well documented file in a stable location
that says where to find the actual accounting file. Currently, atop's
code is full of constructs like

        for PACCTFILE in /var/account/pacct /var/log/pacct
        do
                if [ -f "$PACCTFILE" ]  # file exists?
                then

(which is obviously missing the current plac /var/log/account/pacct)

otoh, if this will be a Debianism, atop's code won't get any easier since atop
will need to continue handling all those places in other
distributions.

Greetings
Marc

#922533#25
Date:
2019-02-21 23:08:35 UTC
From:
To:
Hello Marc

I did some investigation about the localization for pacct in various
distros and i saw that /var/account is the more widely used (Fedora,
RedHat, Gentoo...). This path is the standard even on {Free,Net,Open}BSD
where this file is called acct. So, i migrated the log files to this new
path.

I uploaded a new revision to salsa.d.o [0] but i am not sure if this bug
fixing worths an upload in the middle of a freeze.

If so, could you consider sponsor the package?

Greetings,

Marcos

[0] https://salsa.debian.org/pkg-security-team/acct/

#922533#30
Date:
2019-02-22 15:55:11 UTC
From:
To:
Hi Marcos,

I am not sure whether this was a brilliant idea, many local mechanisms
on existing installations might be looking for the file in the old
place. Also, migration probably needs a gazillion of tests to make sure
that nothing breaks. For how long has the data been in /var/log/?

I am currently not in the position to do the necessary testing, sorry.

Greetings
Marc

#922533#35
Date:
2019-02-22 23:43:11 UTC
From:
To:
Hello Marc

The /var/log/account/ path was introduced by a previous maintainer in
6.3.99+6.4pre1-3 release (2006).

I can't figure out any reason for that. In fact, there were several bugs
reporting troubles caused by this change (#377835
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=377835>, #380744
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=380744>, #385626
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=385626>, #392045
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392045>, #396444
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=396444>).

Instead of reverting this change to the standard path (/var/account), he
decided to fix them setting this new path properly in all pertinent
files and it was in use it since then. AFAIK, you could define any path
you want for store log files.

Greetings,

Marcos.

#922533#42
Date:
2020-01-01 19:58:03 UTC
From:
To:
I'm looking at the proposed fix for this bug and have a few concerns. I hope they can be addressed before the next upload.

1. What about the possibility that /var/log and /var are different filesystems? The preinst may need some error checking to handle out-of-space conditions from mv, and the administrator needs to be warned in advance about the move (I think this calls at least for a mention in the release notes). Moreover, I'm not convinced that the currently proposed preinst script is idempotent (policy §6.2). How about adding a symbolic link from /var/account to /var/log/account on upgrade instead?

2. What happens if both /var/account and /var/log/account already exist? Is it really appropriate to try and clobber an existing /var/account without consulting the administrator? Again, consider the idempotency requirement.

3. I'm not sure offhand whether process accounting will be turned off while the preinst script is running. (The old prerm in buster only stops the acct service on remove, not on upgrade.) If not, there is a risk that accounting records will be written to the old location during the move. (At the same time, I'd like to keep any gap in process accounting coverage at a minimum; but this is a wish, not a requirement.)

#922533#47
Date:
2020-03-17 17:48:30 UTC
From:
To:
Hello Sergio

I am considering the fact that this change could do more harm than
good. The path for pacct* files was changed a long time ago and every
Debian user of acct is aware of it.

The submiter himself has finally some doubts about it, so i believe
that it is pointless.

I can't see any good reason to do this.

I am all for listen to different point of view but i will close this
bug and revert this changes if no good reason arise.

Greetings,
Marcos

#922533#52
Date:
2020-03-18 11:39:01 UTC
From:
To:
Good!

I already uploaded a new release in the git repo:

https://salsa.debian.org/pkg-security-team/acct

It contains this and other changes.

Any DD available for review and upload this new release.

Thank you. Greetings

Marcos

El mié, 18-03-2020 a las 11:33 +0000, Sergio Gelato escribió:

#922533#57
Date:
2020-03-28 11:57:23 UTC
From:
To:
Hi,

Uploaded!

Cheers,

#922533#62
Date:
2024-01-22 09:44:54 UTC
From:
To:
The situation seems to have settled down, and atop now seems to find the
accounting file okay. It has been like that for at least two stable
releases.

Feel free to close this bug report. Thanks for helping!

Greetings
Marc

#922533#67
Date:
2025-09-03 20:35:00 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
acct, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 922533@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andrew Bower <andrew@bower.uk> (supplier of updated acct package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 03 Sep 2025 18:41:32 +0100
Source: acct
Architecture: source
Version: 6.6.4-9
Distribution: unstable
Urgency: medium
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
Changed-By: Andrew Bower <andrew@bower.uk>
Closes: 922533 1023810 1043617 1096275
Changes:
 acct (6.6.4-9) unstable; urgency=medium
 .
   * Fix FTBFS with C23 (Closes: #1096275)
     - use t64 with utmp(5)'s newly unsigned seconds field
   * Use logrotate for daily process accounting log rotation
     - avoid hand-crafted duplication of logrotate smarts
     - drop daily cron job, avoiding needing an equivalent timer
     - provide /usr/share/acct/hooks.d (Closes: #922533)
   * Enable 'build twice' by removing upstream files
     Thanks: Phil Wyett. (Closes: #1043617)
   * Rework init script with init-d-script(5)
     - move lock file to /run. (Closes: #1023810)
     - fix status and one shot properties
     - stop overriding dh_installinit and requiring syslog facility
     - stop using /etc/default/acct (policy 9.3.3.1); document in NEWS
   * Improve systemd integration
     - provide timer for monthly report
     - use tmpfiles.d, enabling removal of d/acct.postinst
     - add documentation
   * Add service hardening
   * d/copyright:
     - swap FSF postal address for URL
     - add myself
     - expand oversimplifications, including autotools/m4 content
   * d/patches:
     - lift maintainer-supplied man page from replace-all patch
     - fix files listing layout in lastcomm.1
     - re-apply info typo fixes to the texi source
     - drop ineffective html unsplitting doc patch to generated Makefile
     - refresh all patches with preferred DEP-3 dialect
   * d/control:
     - update to standards version 4.7.2
     - drop obsolete depends on lsb-base
     - recommend logrotate
     - add myself to Uploaders
   * d/rules:
     - do not set DH_VERBOSE in debian/rules
     - prefer execute_after_dh-style rules
   * d/acct.postrm: make purge resilient to no logs
   * Make various mechanical formatting changes to canonicalize debian/
Checksums-Sha1:
 c66d42bb4af4b7408fd00ebf86c4fef9cc0d2c83 2237 acct_6.6.4-9.dsc
 de20bf04a933bf45e0a2919f6dd5ea81d5e549b4 28044 acct_6.6.4-9.debian.tar.xz
 f6480c32afff8be92869c51e2f16d1a82a5aad02 6258 acct_6.6.4-9_amd64.buildinfo
Checksums-Sha256:
 1f7a20a9a175ddfaf6dc561cb72ebe50ba458916972e356bf0c934ab52d91d2d 2237 acct_6.6.4-9.dsc
 b53ab0a9250629393ad31510ec8a82f51c5425c9d487774f213891da4cc7f57d 28044 acct_6.6.4-9.debian.tar.xz
 e6db2ceff803380e362959843b19f6cb6d59e1bdc6c42952f06860f3bfdb0092 6258 acct_6.6.4-9_amd64.buildinfo
Files:
 7832a0fe5c2fc86be12653e43fc5f82a 2237 admin optional acct_6.6.4-9.dsc
 2d5339c972d8e5a1edd1ea55d9a23fe8 28044 admin optional acct_6.6.4-9.debian.tar.xz
 ba0e93980558e18d905e910517e4e6d7 6258 admin optional acct_6.6.4-9_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEPfXoqkP8n9/QhvGVrfUO2vit1YUFAmi4nxEPHHNnZUBkZWJp
YW4ub3JnAAoJEK31Dtr4rdWFXOAQAKknt2vif5UqgWGDVLK2g8MGLpsbaVER2YNw
JcrvJMLcUgAY37gBMUCo0aS89y+jG9UODKQtrGyXCqOlaFAnM8W9vEtsboAby/wt
PoOCEFntK1ptCHiKgrvj1L9lA1PMvCbhFa7RzDTxm5PDHVzaz5Ikf4X0rPXIL/0R
pbF9psHBb57teJhFgl7/w6PuzATRN7sCIFnp4gntzDOdi609i5XORiAmKDJPGwn8
jgA6g++FVxjxwkQfBUPfKWi/vZLlN4RdKcQuPCPZzeYBbNEXPb92FUW5AbKyW7Sf
co5tMJHZxUjCKFjY3rZovEu4jEQNhVYPjjIXGosmDPn2Ik0lVJecYF2X4YGtciYb
0yWg4WD8R9tzxC7INTO0T7BUmP18v32AQhRkb3L+FadcurvNiQHy/IORxW3dehbK
ogAagEeCxzmbFIPfygESi54vo2o6Xw9hsFW3xSNJBkG40T0ajpv0ggkTelyio1R2
/O2qbaVZcK2CFuHNTY3wTUTXZsALhx07TUxsS4PpecYdZnh2/mv7Fs6EcIaM2T2j
EO5K3xrBtDkF/B6vwA9dmwUEypgHcmNH4daUX/auPXaNvMQkGTRhGjCMoKGzk3+A
wuh5vP98LRSiDOwLL0qeaGRlu5PHG7ZlTAPhMSDr9C0m/Ze+f/m/Rg1rDYbdZ8Fq
j+EqhlqN
=uRW9
-----END PGP SIGNATURE-----