ATOPACCTD(8)
π ATOPACCTD β process accounting daemon π
ok so bestie, welcome to atopacctd(8) from the System Manager's Manual section 8 (that's the "admin commands" shelf, iykyk). this little daemon is the backstage crew that makes the whole process-accounting show run without anyone in the audience noticing. let's get into it π«Ά
β¨ NAME β¨
atopacctd β process accounting daemon
πΈ SYNOPSIS πΈ
atopacctd [-v | topdirectory]
π¦ DESCRIPTION π¦
okay so picture this: the atopacctd daemon flips on the process accounting feature inside the kernel, and it makes the process accounting records get written to a file. from here on out, we're calling that one the source file. once process accounting is live, atopacctd takes every single process accounting record that's sitting there in the source file and transfers it over to a shadow file. then the client processes (things like atop processes) read those shadow files instead of reading the process accounting source file directly.
so basically, atopacctd is operating as a whole 'layer' between the process accounting file that the kernel writes and the shadow accounting files that atop processes read. middle management but make it iconic π
this approach has the following advantages:
- the
atopacctddaemon takes care that the source file is kept to a limited size. the literal second its maximum size is reached, it gets truncated to a size of zero again (and theatopprocesses don't even notice β no drama, no cap). - the
atopacctdaemon takes care that a shadow file is kept to a limited size. as soon as the current shadow file hits this maximum size,atopacctdcreates a new (subsequent) shadow file. while client processes still have the possibility to read the previous shadow file(s),atopacctdkeeps writing accounting records to the newest (current) shadow file. that's why the name of a shadow file is a 10-digit sequence number followed by the extension.paf(process acounting file). old shadow files that client processes aren't using any more get automatically removed by the garbage collector inside theatopacctddaemon. spring cleaning behavior, honestly π§Ήβ¨ - when no client processes are active (any more), all shadow files will be deleted and no records will be transferred to a shadow file any more. and the moment at least one client is activate again,
atopacctdpicks right back up writing shadow files. she's so resilient, we love her π
the directory /var/run is used as the default topdirectory. below this top-directory, the source file pacct_source is created, and that's where the kernel writes the process accounting records.
also, the subdirectory pacct_shadow.d gets created as a 'container' for the shadow files. apart from the shadow files, the file current is also maintained in this subdirectory, and it contains the sequence number of the current (newest) shadow file plus the maximum number of records that will be written in each shadow file.
you can specify an alternative topdirectory as a command line argument. when an alternative topdirectory is defined, you also need to modify the configuration file /etc/atoprc to inform atop clients about this alternative location (go check the atoprc man page, bestie). such alternative topdirectory should be owned by root and may not be writable for the group or others β security reasons, periodt. π
heads up: notice that the kernel suspends writing process accounting records when the free space of the filesystem on which the process accounting file resides drops below 2%. writing is resumed when the free space is 4% or more. these lowwater and highwater percentages can be configured via the /proc/sys/kernel/acct pseudo-file.
and the atopacctd daemon itself suspends transferring process accounting records to shadow files when the free space of the filesystem on which the process accounting file resides drops below 5%. transfer is resumed when the free space is 5% or more. log messages get generated via syslog when writing to the current shadow file is suspended or resumed. π’
the -v flag can be used to verify the version of the atopacctd daemon. cute and useful.
π FILES π
/var/run/pacct_sourceβ regular file to which the kernel writes the process accounting records. this file will be regularly truncated. (she reinvents herself constantly π)/var/run/pacct_shadow.d/currentβ regular file containing the sequence number of the current shadow file and the maximum number of records per shadow file./var/run/pacct_shadow.d/N.pafβ regular files containing the process accounting records that have been copied transparently from the source file (N represents a 10-digit sequence number).
π SEE ALSO π
atop(1), atopsar(1), atoprc(5), netatop(4), netatopd(8)
π AUTHOR π
Gerlof Langeveld (gerlof.langeveld@atoptool.nl) β absolute legend, fr fr π
and that's the whole vibe! this page came to you from the Linux manual, January 2024, and it's the ATOPACCTD(8) page β go forth and account for your processes, bestie π¦β¨π
π¦ where this page comes from
- alpine 3.22: atop-doc 2.11.1-r0 Β· GPL-2.0-or-later
- alpine 3.23: atop-doc 2.12.1-r0 Β· GPL-2.0-or-later
- alpine 3.24: atop-doc 2.12.1-r0 Β· GPL-2.0-or-later
- arch rolling: atop 2.13.0-1 Β· GPL-2.0-or-later
- epel 10: atop 2.11.1-1.el10_1 Β· GPL-2.0-or-later
- fedora 43: atop 2.12.1-1.fc43 Β· GPL-2.0-or-later
- fedora 44: atop 2.12.1-3.fc44 Β· GPL-2.0-or-later
- fedora 44: atop 2.13.0-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: atop 2.12.1
- nixpkgs unstable: atop 2.13.0
- opensuse-leap 16.0: atop-daemon 2.11.1-bp160.1.4 Β· GPL-2.0-only
- opensuse-leap 16.0: atop-daemon 2.11.1-bp160.1.4 Β· GPL-2.0-only
- opensuse-leap 16.0: atop-daemon 2.11.1-bp160.1.4 Β· GPL-2.0-only
- opensuse-leap 16.0: atop-daemon 2.11.1-bp160.1.4 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms