ACCT(5) File Formats Manual ACCT(5)NAME
acct - execution accounting file
SYNOPSIS
#include <sys/acct.h>
DESCRIPTION Acct(2) causes entries to be made into an accounting file for each process that terminates. The accounting file is a sequence of entries
whose layout, as defined by the include file is:
If the process does an exec(2), the first 10 characters of the filename appear in ac_comm. The accounting flag contains bits indicating
whether exec(2) was ever accomplished, and whether the process ever had super-user privileges.
SEE ALSO acct(2), sa(1)ACCT(5)
Check Out this Related Man Page
ACCT(5) BSD File Formats Manual ACCT(5)NAME
acct -- execution accounting file
SYNOPSIS
#include <sys/acct.h>
DESCRIPTION
The kernel maintains the following acct information structure for all processes. If a process terminates, and accounting is enabled, the ker-
nel calls the acct(2) function call to prepare and append the record to the accounting file.
/*
* Accounting structures; these use a comp_t type which is a 3 bits base 8
* exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ
* seconds.
*/
typedef u_short comp_t;
struct acct {
char ac_comm[10]; /* name of command */
comp_t ac_utime; /* user time */
comp_t ac_stime; /* system time */
comp_t ac_etime; /* elapsed time */
time_t ac_btime; /* starting time */
uid_t ac_uid; /* user id */
gid_t ac_gid; /* group id */
short ac_mem; /* memory usage average */
comp_t ac_io; /* count of IO blocks */
dev_t ac_tty; /* controlling tty */
#define AFORK 0x01 /* forked but not execed */
#define ASU 0x02 /* used super-user permissions */
#define ACOMPAT 0x04 /* used compatibility mode */
#define ACORE 0x08 /* dumped core */
#define AXSIG 0x10 /* killed by a signal */
char ac_flag; /* accounting flags */
};
/*
* 1/AHZ is the granularity of the data encoded in the comp_t fields.
* This is not necessarily equal to hz.
*/
#define AHZ 64
#ifdef KERNEL
struct vnode *acctp;
#endif
If a terminated process was created by an execve(2), the name of the executed file (at most ten characters of it) is saved in the field
ac_comm and its status is saved by setting one of more of the following flags in ac_flag: AFORK, ASU, ACOMPAT, ACORE and ASIG.
SEE ALSO lastcomm(1), acct(2), execve(2), accton(8), sa(8)HISTORY
A acct file format appeared in Version 7 AT&T UNIX.
BSD June 5, 1993 BSD
When i excute the command:
# /usr/sbin/acct/accton /var/adm/acct
it prompt error:
#/usr/sbin/acct/accton: file mode not 0664
Who can help me to start process-accounting procedures,Thanks! (2 Replies)
Hi everybody,
I'm Sun Solaris, I have problems on figuring out how i can start acct in unix. I understand how this accounting write in a file in /var/adm/wtmp. And with "acctcom -b " shows end part of all commands that were written in it. And "accton" shuts off this reporting. My question how... (3 Replies)
I recently started using unix in osx,and loving it! I am now wanting to use pine for email. I installed it using fink and besides it not being the most updated version, it seems to work fine, except that every message I erase seems to come back everytime I log in. It is a pop3 account. I have also... (0 Replies)
How do I enable System Accounting on Solaris 8? In Solaris 7 I would copy the /usr/lib/acct file to S22acct and start it like that. That doesn't seem to be an option in Solaris 8.
Thanks for your help! (2 Replies)
Hi All,
I want to know the any process end time using the "acctcom" command.
I think "ps" command will give only running processes Start time.
But i want know the running & completed processes:
1. Start Time
2. End Time
3. Process Name/Command Name
4. PID
Please... (1 Reply)
Hi,
On my server there are so many pacct files in /var/adm. It is eating up my /var partition. Can I delete or gzip those files ?
Thanks
NeeleshG (3 Replies)
My scenario is as follows:
We have a handful of batch accounts that run our production jobs. Our users are able to use sudo to become that account. Also, because of other reasons, the passwords are also listed in an encrypted file that each team can see their batch ID. So, I have some users... (5 Replies)
I need to figure out why did the system run out of memory and hung at a certain time. For further investigation, the info about every processes' CPU and memory consumption over time would be of high value.
I see, that Unix accounting may be of some help. But I'm not sure if I can get this... (3 Replies)
I am trying to show the number of dead accts or false shells running and include a count at the end. Does anyone know how to go about this? Thanks - citizencro (3 Replies)
I need to write a script, which takes the input a log file and create output file with acct no's line by line from selected records with text like (in red) :
18:51:18 | 217863|Acct 0110855565|RC 17608| 16 Subs| 1596 UsgRecs| 2 Secs| 430 CPUms| prmis2:26213 <MoveUsage d
aemon needs to run... (7 Replies)
I have a txt file with contents of acct nbr's like:
22222222222
33333333333
33445566778
I need to write a script which takes each acct nbr in the file and run the query like:
select seq_nbr from event where acct_nbr='22222222222'
and the query's output should be passed to a... (2 Replies)
Hi,
Examining the Debian Linux logfiles, I found out that not all commands are logged in my pacct (/var/log/account/pacct)
For instance, if I run and stop Wireshark and do after that
# lastcomm | grep "wireshark"
The wireshark command is logged as expected.
# lastcomm | grep... (1 Reply)