Way back a long time ago, Thompson and Ritchie were sitting opposite one another at the commissary, sipping coffees and discussing their evolving behemoth.
“This behemoth of ours,” said Ken, “is becoming rather popular, wouldn’t you say?” “Yes,” said Dennis. “Every time I want to do a compilation, I have to wait for hours and hours. It’s infuriating.” They both agreed that the load on their system was too great. Both sighed, picked up their mugs, and went back to the workbench. Little did they know that an upper-management type was sitting just within earshot of their conversation.
“We are AT&T Bell Laboratories, aren’t we?” the upper-management type thought to himself. “Well, what is our organization best known for?” The brill-cream in his hair glistened. “Screwing people out of lots of money, of course! If there were some way that we could keep tabs on users and charge them through the nose for their CPU time...”
The accounting utilities were born.
Years later Markus Gothe was a facing the CEO at his work, keep asking him where and how he got the information on other employees payrolls. There was indeed a conflict, Markus denied all the modus operandi on how to get held of such copies or information. Plans was made up to frame him, by interception.
This momement Markus realized the words of Rob Savoye “You cannot buy yourself free from guilt.” He left the room with pride, for making a stand. However, sadly enogh, the CEO never realized that meaning. You cannot buy yourself free from guilt; A new revival had come for the GNU acccounting utilities and so a POSIX-standard.
Seriously though, the accouting utilities can provide a system administrator with useful information about system usage—connections, programs executed, and utilization of system resources.
Information about users—their connect time, location, programs
executed, and the like—is automatically recored in files by
login. Four of them are of interest to us:
wtmp, which has records for each login and logout;
acct, which records each command that was run;
savacct, which contain
summaries of the information in
acct by user and
command, respectively. Each of the accounting utilities reports or
summarizes information stored in these files.
prints statistics about users’ connect time.
ac can tell you how
long a particular user or group of users were connected to your system,
printing totals by day or for all of the entries in the
turns accounting on or off.
lists the commands executed on the system, most recent first, showing
the run state of each command. With
last, you can search the
acct file for a particular user, terminal, or command.
summarizes the information in the
acct file into the
usracct file. It also
generates reports about commands, giving the number of invocations, cpu
time used, average core usage, etc.
utmp files in a human-readable format.
For more detailed information on any of these programs, check the chapter with the program title.
acct files seem to live in different places
and have different names for every variant of u*x that exists. The name
wtmp seems to be standard for the login accounting file, but the
process accounting file might be
pacct on your
system. To find the actual locations and names of these files on your
system, specify the
--help flag to any of the programs in this
package and the information will dumped to standard output.
Regardless of the names and locations of files on your system, this
manual will refer to the login accounting file as
wtmp and the
process accounting files as
The detailed format of the
acct file written by the Linux kernel
varies depending on the kernel’s version and configuration:
Linux kernels 2.6.7 and earlier write a v0 format
which unfortunately cannot store user and group ids (
larger than 65535.
Kernels 2.6.8 and later write the
acct file in v1, v2 or v3 formats.
BSD_PROCESS_ACCT_V3 is selected in the kernel configuration,
otherwise v1 if on the m68k architecture or v2 everywhere else).
Since version 6.4 the GNU accounting utilities on Linux systems are
able to read all of the v0, v2 and v3 file formats (v1 is not supported).
Thus you do not need to worry about the details given above. You can even
acct files where different records were written by differently
configured kernels (you can find out about the format of each entry by
dump-acct utility). In case you ever need to convert
acct file to a different format, the
--raw option of
dump-acct does that together with the new
--byteswap options that determine format and byte order of the
Multiformat support under Linux is intended to be a temporary solution
to aid in switching to the v3
acct file format. So do not expect
GNU acct 6.7 to still contain Multiformat support. In a few years
time, when everybody uses the v3 format, the ability to read multiple
formats at runtime will probably be dropped again from the GNU accounting
This does not, however, affect the ability to adapt to the
format at compile time (when
./configure is run). Even GNU acct 6.3.5
(that does not know about multiple file formats) will yield working binary
programs when compiled under a (as yet hypothetical) Linux kernel 2.6.62
that is only able to write the v3 format.
I don’t have any idea who originally wrote these utilities. If anybody
does, please send some mail to
firstname.lastname@example.org and I’ll add
your information here!
Since the first alpha versions of this software in late 1993, many people have contributed to the package. They are (in alphabetical order):
Eric Backus <email@example.com>
Suggested fixes for HP-UX 9.05 using /bin/cc: configure assumed you were
gcc and tacked on
-Wall etc. He also noticed that
file_rd.c was doing pointer arithmetic on a
void * pointer
Christoph Badura <firstname.lastname@example.org>
Christoph was a BIG HELP in computing statistics, most notably k*sec stuff! He also did Xenix testing and contributed some Makefile fixes and output optimizations.
Michael Calwas <email@example.com>
Fixed bugs in mktime.c.
Derek Clegg <firstname.lastname@example.org>
Suggested the simple, elegant fix for *_rd_never_used brain-damage.
Alan Cox <email@example.com>
Original Linux kernel accounting patches.
Scott Crosby <firstname.lastname@example.org>
Suggested idea behind
Solar Designer <email@example.com>
Added code for
--ahz flag in
Dirk Eddelbuettel <firstname.lastname@example.org>
Managed bug-fixes & etc. for Debian distribution, as well as the architect of merge of GNU + Debian distributions. A big thanks to Dirk for kicking me back into gear again after a long period of no work on this project.
Jason Grant <email@example.com>
Identified a buffer-overrun bug in
Kaveh R. Ghazi <firstname.lastname@example.org>
Tested the package on many systems with compilers other than gcc. Fixed K&R C support.
Susan Kleinmann <email@example.com>
Contributed excellent man pages!
Alexander Kourakos <Alexander@Kourakos.com>
--wide option for
Marek Michalkiewicz <firstname.lastname@example.org>
--ip-address flag for
David S. Miller <email@example.com>
Noticed missing GNU-standard makefile rules.
Walter Mueller <firstname.lastname@example.org>
Noticed install target was missing, and corrected a typo for prefix in Makefile.in.
Ian Murdock <email@example.com>
Tracked down miscellaneous bugs in sa.c under Linux. Added Debian package maintenance files.
Tuomo Pyhala <firstname.lastname@example.org>
--strict-match flag in
Tim Schmielau <email@example.com>
Added Linux multiformat support.
Luc I. Suryo <firstname.lastname@example.org>
--user flag for
Pedro A M Vazquez <email@example.com>
Fixed bugs in sa.c and tested under FreeBSD.
Marco van Wieringen <Marco.van.Wieringen@mcs.nl.mugnet.org>
Modified (wrote?) Linux kernel accounting patches.