H2 get lastcomm/accounting working

James Bond

Registered
lastcomm give me:

lastcomm: /var/account/acct: No such file or directory

I presume that some accouting option is not turned on but researching man does not shed light on it (for me at least)....what needs to be activated/set for this to work?
 
(Note this is untested; just information I've seen in the startup scripts).

It should be as easy as running (in Terminal, and as root most likely, or prefixing all commands with sudo),

mkdir /var/account
touch /var/account/acct
accton /var/account/acct

If you look at,

/System/Library/StartupItems/Accounting/Accounting

you'll see that on reboots, if the file /var/account/acct exists, accounting is turned on.
Note also that there is a set of entries in /etc/daily to clean up the accounting stuff from cron.
 
I have done all this but still no accounting seems to happen.

The reason why I am interested now is that since installing OS 10.0.4 things seem to be much more sluggish and I would like to see if I can get any clues as to what is causing this......or do you have better ideas to pin-point that type of problem?
 
Well, it definitely doesn't seem to want to work; accton appears to work okay (tried my own program to call acct() directly, which didn't error out). A check of the kernel, 'nm /mach_kernel | grep acct' shows the accounting calls are there. It just doesn't seem to trap the end of processes to write out to the accounting file.
 
Back
Top