runacct(8) CLIX runacct(8)
NAME
runacct - Runs daily system accounting
SYNOPSIS
/usr/lib/acct/runacct [mmdd [state]]
DESCRIPTION
The runacct command is the main daily accounting shell procedure. It is
normally initiated with cron. The runacct command processes connect time,
fee, disk, and process accounting files. It also prepares summary files
for the prdaily command or for billing purposes.
The runacct command attempts to not damage active accounting files or
summary files if errors occur. It records its progress by writing
descriptive diagnostic messages into the active file. When an error is
detected, a message is written to the /dev/console file, mail is sent to
the root and adm accounts, and runacct terminates. This command uses a
series of lock files to protect itself from being reinvoked improperly.
The files lock and lock1 prevent simultaneous invocation, and lastdate
prevents more than one invocation per day.
The runacct command breaks the file processing into separate, restartable
states using the file statefile to remember the last state completed. It
accomplishes this by writing the state name into statefile. The runacct
command then checks statefile to determine its state and to determine what
to process next. States are executed in the following order:
SETUP Moves active accounting files into working files.
WTMPFIX
Verifies the integrity of the /etc/wtmp file, correcting date
changes if necessary.
CONNECT1
Produces connect session records in the ctmp structure format.
CONNECT2
Converts the ctmp structure format records to the tacct structure
format.
PROCESS
Converts process accounting records to the tacct structure format.
MERGE Merges the connect and process accounting records.
FEES Converts output of the chargefee command into tacct structure
format and merges with connect and process accounting records.
2/94 - Intergraph Corporation 1
runacct(8) CLIX runacct(8)
DISK Merges disk accounting records with connect, process, and fee
accounting records.
MERGETACCT
Merges the daily total accounting records in the
/usr/adm/acct/nite/daytacct file with the summary total accounting
records in the /usr/adm/acct/sum/tacct file.
CMS Produces command summaries.
USEREXIT
Includes any installation-dependent accounting commands here.
CLEANUP
Cleans up temporary files and exits.
To restart runacct after a failure, first check the active file for
diagnostics. Then repair any corrupted data files such as pacct or wtmp.
The lock, lock1, and lastdate files must be removed before runacct can be
restarted. The argument mmdd is necessary if runacct is being restarted.
The mmdd argument specifies the month and day for which runacct will re-
run the accounting. The entry point for processing is based on the
contents of statefile. To override this, include the desired state on the
command line to designate where processing is to begin.
EXAMPLES
1. This example starts runacct.
nohup runacct 2>/usr/adm/acct/nite/fd2log &
2. This example restarts runacct.
nohup runacct 0601 2>>/usr/adm/acct/nite/fd2log &
3. This example restarts runacct at a specific state, which is to merge
the connect and process accounting records.
nohup runacct 0601 MERGE 2>>/usr/adm/acct/nite/fd2log &
FILES
/etc/wtmp Login/logout history.
/usr/adm/pacct Current progress accounting file.
/usr/adm/acct/nite/active Progress record.
2 Intergraph Corporation - 2/94
runacct(8) CLIX runacct(8)
/usr/adm/acct/nite/daytacct Total accounting records.
/usr/adm/acct/nite/lock Lock file.
/usr/adm/acct/nite/lock1 Lock file.
/usr/adm/acct/nite/lastdate Prevents use more than once a day.
/usr/adm/acct/nite/statefile Last state completed.
/usr/adm/acct/nite/ptacct/mmdd One day's records.
CAUTIONS
If runacct fails in the SETUP state, run SETUP manually. To restart
runacct, use the following command:
runacct mmdd WTMPFIX
If runacct fails in the PROCESS state, remove the last ptacct/mmdd file
because it will not be complete.
DIAGNOSTICS
If runacct encounters a problem, it writes a message to stderr. If it
encounters a fatal error, it writes a message on the /dev/console file.
EXIT VALUES
The exit values are not valid.
RELATED INFORMATION
Commands: acct(8), acctcms(8), acctcon(8), acctmerg(8), acctprc(8),
acctsh(8), fwtmp(8), cron(8), acctcom(8)
Functions: acct(2)
Files: acct(4), utmp(4)
2/94 - Intergraph Corporation 3