#1023810 acct: Initscript complains about non-existant /var/lock/subsys/

Package:
acct
Source:
acct
Description:
GNU Accounting utilities for process and login accounting
Submitter:
Hendrik Jaeger
Date:
2025-09-03 20:37:02 UTC
Severity:
normal
Tags:
#1023810#5
Date:
2022-11-10 13:15:50 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

A mail from Anacron containing:
/etc/cron.daily/acct:
touch: cannot touch '/var/lock/subsys/acct': No such file or directory

Running the initscript manually gives the same error.

(Accounting needs to be enabled in /etc/default/acct or the error will
not occur)

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

/var/lock/subsys/ does not exist on my sysvinit-based systems:
# namei -l '/var/lock/subsys/acct'
f: /var/lock/subsys/acct
drwxr-xr-x root root /
drwxr-xr-x root root var
lrwxrwxrwx root root lock -> /run/lock
drwxr-xr-x root root   /
drwxr-xr-x root root   run
drwxrwxrwt root root   lock
                     subsys - No such file or directory

AFAIU this directory is created on systemd-based systems but does not
seem to get created on sysvinit-based systems.
Since it’s on a tmpfs, creating it manually would not help permanently:
# df -h /var/lock/
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           5.0M     0  5.0M   0% /run/lock


I don’t know where this directory is supposed to be coming from on
sysvinit-based systems.
Maybe the acct initscript should check whether it exists and create it
if needed?

Thanks

Hendrik

#1023810#10
Date:
2023-08-18 17:57:36 UTC
From:
To:
As a workaround, set LOCKFILE=/var/lock/acct in your /etc/defaults/acct.

Editing /etc/init.d/acct directly is less desirable, as Debian maintainters
feeling too righteous are known to delete init.d scripts they deemed
"obsolete" without any warning, while config files in /etc/defaults are
relatively safe.

(I got my /var stuffed with ever-growing /var/log/pacct as the rotation
stopped because of that stupid "subsys" shit. If this is not a sabotage, then
what it is?)

#1023810#15
Date:
2023-08-18 17:26:23 UTC
From:
To:
Just another act of sabotage against "init-system diversity" in Debian, no news at all. What was wrong with plain old /var/locl/acct, FFS?
#1023810#20
Date:
2024-08-11 09:26:01 UTC
From:
To:
Hi,
The attached patch, "acct.init.d.patch" resolves the issue
by creating the missing subdirectory inside /var/lock.

I also include for consideration a second version of the
patch, "acct.init.d-v2.patch", which creates the proper
subdirectory even if a non-default value is entered by
the system administrator in the LOCKFILE variable at
/etc/default/acct.

Cheers,
Georgios

#1023810#27
Date:
2025-06-25 20:42:16 UTC
From:
To:
Hi Alex,

I couldn't reproduce this behaviour.

So far as I can tell, the current 'lockfile' implementation is entirely
cosmetic, both when it works and when it doesn't! (The return code
doesn't even get set differently for the 'status' operation.)

I ask because this would affect the severity of the bug, which is
relevant during the current freeze.

Thanks!

#1023810#32
Date:
2025-08-17 20:11:09 UTC
From:
To:
I have proposed a different fix to the patches already attached to this
bug. The init script was completely broken. I have rewritten it as part
of https://salsa.debian.org/pkg-security-team/acct/-/merge_requests/8
and the 'lock' file to enforce the single shot nature of the service now
resides at /run/acct.oneshot, which does not require creating any new
directories at runtime.

#1023810#39
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 1023810@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-----