.ds :? The P\s-1WB\s+1/\s-1UNIX\s+1 Accounting System .tr ~ .TL 82117-140 The P\s-1WB\s+1/\s-1UNIX\s+1 Accounting System .AU "Henry S. McCreary" HSM PY 3784 7827 1J-251 .AS 1 .P The P\s-1WB\s0/\s-1UNIX\s0* .FS * U\s-1NIX\s+1 is a Trademark of Bell Laboratories. .FE Accounting System provides methods to collect per-process resource utilization data, record connect sessions, monitor disk utilization, and charge fees to specific logins. A set of C programs and shell procedures is provided to reduce this accounting data into summary files and reports. This memorandum describes the structure, implementation, and management of this accounting system. .AE .MT 4 .PH "''''" .OH "'\s9\f2\*(:?\fP''\\\\n%\s0'" .EH "'\s9\\\\n%''\f2\*(:?\^\fP\s0'" .H 1 "Introduction" The P\s-1WB\s0/\s-1UNIX\s0* .FS * U\s-1NIX is a Trademark of Bell Laboratories. .FE accounting system was originally designed by John Mashey. Several modifications and additions have been made to make the system easier to manage, and to make it less susceptible to corrupted data or system errors. The following list is a synopsis of the actions of the accounting system: .BL .LI At process termination the \s-1UNIX\s0 Kernal writes one record per process in .B /usr/adm/pacct in the form of .I acct.h .\*F .FS See Attachment 2 for a description of data files. .FE .LI The .I login and .I init programs record connect sessions by writing records into .B /usr/adm/wtmp . Date changes, reboots, and shutdowns are also recorded in this file. .LI The disk utilization program .I acctdusg, breaks down disk usage by login. .LI Fees for file restores, etc, can be charged to specific logins with the .I chargefee shell procedure. .LI Each day the .I runacct shell procedure is executed via .I cron to reduce accounting data, produce summary files and reports.\*F .FS See Attachment 3 for a sample report output. .FE .LI The .I monacct procedure can be executed on a monthly or fiscal period basis. It saves and restarts summary files, generates a report, and cleans up the .B sum directory. These saved summary files could be used to charge users for \s-1UNIX\s0 usage. .LE .H 1 "Files and Directories" The .B /usr/lib/acct directory contains all of the C programs and shell procedures necessary to run the accounting system. The .B adm login (\s-1UID\s0 4) is used by the accounting system and has the following directory structure: .DS 2 0 .B /usr/adm | .B acct | ----------------------- | | | \fBnite~~~~~~~sum~~~~~~fiscal\fP .DE .P The .B /usr/adm directory contains the active data collection files.\*F .FS For a complete explanation of the files used by the accounting system, see Attachment 1. .FE The .B nite directory contains files that are re-used daily by the .I runacct procedure. The .B sum directory contains the cumulative summary files updated by .I runacct . The .B fiscal directory contains periodic summary files created by .I monacct . .H 1 "Daily Operation" When \s-1UNIX\s0 is switched into multi-user mode, .B /usr/lib/acct/startup is executed which does the following: .AL 1 .LI The .I acctwtmp program adds a ``boot'' record to .B /usr/adm/wtmp . This record is signified by using the system name as the login name in the .B wtmp record. .LI Process accounting is started via .I turnacct . .I "Turnacct on" executes the .I accton program with the argument .B /usr/adm/pacct . .LI The .I remove shell procedure is executed to cleanup the saved .B pacct and .B wtmp files left in the .B sum directory by .I runacct. .LE .P The .I ckpacct procedure is run via .I cron every hour of the day to check the size of .B /usr/adm/pacct . If the file grows past 1000 blocks (default), .I "turnacct switch" is executed. While .I ckpacct is not absolutely necessary, the advantage of having several smaller .B pacct files becomes apparent when trying to restart .I runacct after a failure processing these records. .P The .I chargefee program can be used to bill users for file restores, etc. It adds records to .B /usr/adm/fee which are picked up and processed by the next execution of .I runacct and merged into the total accounting records. .P .I Runacct is executed via .I cron each night. It processes the active accounting files, .B /usr/adm/pacct \fI?\fP, .B /usr/adm/wtmp , .B /usr/adm/acct/nite/disktacct , and .B /usr/adm/fee . It produces command summaries and usage summaries by login. .P When the system is shut down using .I shutdown , the .I shutacct shell procedure is executed. It writes a shutdown reason record into .B /usr/adm/wtmp and turns process accounting off. .P After the first re-boot each morning, the computer operator is instructed by .I /etc/rc to execute .B /usr/lib/acct/prdaily to print the previous day's accounting report. .H 1 "Setting up the Accounting System" In order to automate the operation of this accounting system, several things need to be done: .AL 1 .LI If not already present, add this line to the .B /etc/rc file in the state 2 section: .br .B "/bin/su \- adm \-c /usr/lib/acct/startup" .LI If not already present, add this line to .I /etc/shutdown to turn off the accounting before the system is brought down: .br .B /usr/lib/acct/shutacct .LI Three entries should be made in .B /usr/lib/crontab so that .I cron will automatically start some shell procedures. .B .ps -2 0 4 * * 1-6 /bin/su - adm -c "/usr/lib/acct/runacct 2> /usr/adm/acct/nite/fd2log" 0 2 * * 4 /bin/su - adm -c "/usr/lib/acct/sdisk" 5 * * * * /bin/su - adm -c "/usr/lib/acct/ckpacct" .ps +2 .R .LI The .B \s-1PATH\s0 shell variable in .B adm 's .B .profile should be set to: .br .B \s-1PATH\s0=/usr/lib/acct:/bin:/usr/bin .LE .H 1 "Runacct" .I Runacct is the main daily accounting shell procedure. It is normally initiated via .I cron during non-prime time hours. .I Runacct processes connect, fee, disk, and process accounting files. It also prepares daily and cumulative summary files for use by .I prdaily or for billing purposes. The following files produced by .I runacct are of particular interest. .VL 20 2 .LI \fBnite/lineuse\fP Produced by .I acctcon1 , which reads the .B wtmp file, and produces usage statistics for each terminal line on the system. This report is especially useful for detecting bad lines. If the ratio between the number of logoffs to logins exceeds about 3/1, there is a good possibility that the line is failing. .LI \fBnite/daytacct\fP This file is the total accounting file for the previous day in \fItacct.h\fP format. .LI \fBsum/tacct\fP This file is the accumulation of each day's .B nite/daytacct , which can be used for billing purposes. It is restarted each month or fiscal by the .I monacct procedure. .LI \fBsum/daycms\fP Produced by the .I acctcms program, it contains the daily command summary. The \s-1ASCII\s0 version of this file is .B nite/daycms . .LI \fBsum/cms\fP The accumulation of each day's command summaries. It is restarted by the execution of .I monacct . The \s-1ASCII\s0 version is .B nite/cms . .LI \fBsum/loginlog\fP Produced by the .I lastlogin shell procedure, it maintains a record of the last time each login was used. .LI \fBsum/rprt.\fP\fI\s-1MMDD\s0\fP Each execution of .I runacct saves a copy of the output of .I prdaily . .LE .P .I Runacct takes care not to damage files in the event of errors. A series of protection mechanisms are used that attempt to recognize an error, provide intelligent diagnostics, and terminate processing in such a way that .I runacct can be restarted with minimal intervention. It records its progress by writing descriptive messages into the file .B active.\*F .FS Files used by .I runacct are assumed to be in the .B nite directory unless otherwise noted. .FE All diagnostic output during the execution of .I runacct is written into .B fd2log . To prevent multiple invocations, in the event of two crons or other problems, .I runacct will complain if the files .B lock and .B lock1 exist when invoked. The .B lastdate file contains the month and day .I runacct was last invoked, and is used to prevent more than one execution per day. If .I runacct detects an error, a message is written to .B /dev/console , mail is sent to .B root and .B adm , the locks are removed, diagnostic files are saved, and execution is terminated. .P In order to allow .I runacct to be restartable, processing is broken down into separate reentrant states. This is accomplished by using a .B case statement inside an endless .B while loop. Each state is one case of the .B case statement. A file is used to remember the last state completed. When each state completes, .B statefile is updated to reflect the next state. In the next loop through the .B while , .B statefile is read and the .B case falls through to the next state. When .I runacct reaches the .B \s-1CLEANUP\s0 state, it removes the locks and terminates. .I States are executed in the following order: .VL 20 2 .LI \fB\s-1SETUP\s0\fP The command .B turnacct~switch is executed. The process accounting files, .B /usr/adm/pacct\fI?\fP , are moved to .B /usr/adm/Spacct\fI?.\s-1MMDD\s0\fP . The .B /usr/adm/wtmp file is moved to .B /usr/adm/acct/nite/wtmp.\fI\s-1MMDD\s0\fP with the current time added on the end. .LI \fB\s-1WTMPFIX\s0\fP The .B wtmp file in the .B nite directory is checked for correctness by the .I wtmpfix program. Some date changes will cause .I acctcon1 to fail, so .I wtmpfix attempts to adjust the time stamps in the .B wtmp file if a date change record appears. .LI \fB\s-1CONNECT\s01\fP Connect session records are written to .B ctmp in the form of .I ctmp.h . The .B lineuse file is created, and the .B reboots file is created showing all of the boot records found in the .B wtmp file. .LI \fB\s-1CONNECT\s02\fP .B Ctmp is converted to .B ctacct.\fI\s-1MMDD\s0\fP which are connect accounting records.\*F .FS Accounting records are in .I tacct.h format. .FE .LI \fB\s-1PROCESS\s0\fP The .I acctprc1 and .I acctprc2 programs are used to convert the process accounting files, .B /usr/adm/Spacct\fI?.\s-1MMDD\s0\fP , into total accounting records in .B ptacct\fI?.\s-1MMDD\s0\fP . The .B Spacct and .B ptacct files are correlated by number so that if .I runacct fails, the unnecessary reprocessing of .B Spacct files will not occur. One precaution should be noted; when restarting .I runacct in this state, remove the last ptacct file because it will not be complete. .LI \fB\s-1MERGE\s0\fP Merge the process accounting records with the connect accounting records to form .B daytacct . .LI \fB\s-1FEES\s0\fP merge in any \s-1ASCII\s0 .I tacct records from the file .B fee into .B daytacct . .LI \fB\s-1DISK\s0\fP On the day after the .I sdisk procedure runs, merge .B disktacct with .B daytacct . .LI \fB\s-1MERGETACCT\s0\fP Merge .B daytacct with .B sum/tacct , the cumulative total accounting file. Each day, .B daytacct is saved in .B sum/tacct\fI\s-1MMDD\s0\fP , so that .B sum/tacct can be recreated in the event it becomes corrupted or lost. .LI \fB\s-1CMS\s0\fP Merge in today's command summary with the cumulative command summary file .B sum/cms . Produce \s-1ASCII\s0 and internal format command summary files. .LI \fB\s-1USEREXIT\s0\fP Any installation dependent (local) accounting programs can be included here. .LI \fB\s-1CLEANUP\s0\fP Clean up temporary files, run .I prdaily and save its output in .B sum/rprt\fI\s-1MMDD\s0\fP , remove the locks, then exit. .LE .H 1 "Recovering from failure" .P The .I runacct procedure can fail for a variety of reasons; usually due to a system crash, .B /usr running out of space, or a corrupted .B wtmp file. If the .B active\fI\s-1MMDD\s0\fP file exists, check it first for error messages. If the .B active file and lock files exist, check .B fd2log for any mysterious messages. The following are error messages produced by .I runacct , and the recommended recovery actions: .sp .B \s-1ERROR\s0:~locks~found,~run~aborted .br The files .B lock and .B lock1 were found. These files must be removed before .I runacct can restart. .sp .B \s-1ERROR\s0:~acctg~already~run~for~\fIdate\fP~:~check~/usr/adm/acct/nite/lastdate .br The date in .B lastdate and today's date are the same. Remove .B lastdate . .sp .B \s-1ERROR\s0:~turnacct~switch~returned~rc=\fI?\fP .br Check the integrity of .I turnacct and .I accton . The .I accton program must be owned by .B root , and have the setuid bit set. .sp .B \s-1ERROR\s0:~Spacct\fI?.\s-1MMDD\s0\fP~already~exists .br .B file~setups~probably~already~run .br Check status of files, then run setups manually. .sp .B \s-1ERROR\s0:~/usr/adm/acct/nite/wtmp.\fI\s-1MMDD\s0\fP~already~exists,~run~setup~manually .br Self-explanatory. .sp .B \s-1ERROR\s0:~wtmpfix~errors~~see~/usr/adm/acct/nite/wtmperror .br .I Wtmpfix detected a corrupted .B wtmp file. Use .I fwtmp to correct the corrupted file. .sp .B \s-1ERROR\s0:~connect~acctg~failed:~check~/usr/adm/acct/nite/log .br The .I acctcon1 program encountered a bad .B wtmp file. Use .I fwtmp to correct the bad file. .sp .B \s-1ERROR\s0:~Invalid~state,~check~/usr/adm/acct/nite/active .br The file, .B statefile , is probably corrupted. Check .B statefile and read .B active before restarting. .H 1 "Restarting runacct" .P .I Runacct called without arguments assumes that this is the first invocation of the day. The argument .I \s-1MMDD\s0 is necessary if .I runacct is being restarted, and specifies the month and day for which .I runacct will rerun the accounting. The entry point for processing is based on the contents of .B statefile . To override .B statefile , include the desired .I state on the command line. .br Examples: .sp .in +5 To start \fIrunacct\fP: .br .B ~~~~~nohup~runacct~~2>~~/usr/adm/acct/nite/fd2log& .sp To restart \fIrunacct\fP: .br .B ~~~~~nohup~runacct~0601~~2>~~/usr/adm/acct/nite/fd2log& .sp To restart \fIrunacct\fP at a specific state: .br .B ~~~~~nohup~runacct~0601~\s-1WTMPFIX\s0~~2>~~/usr/adm/acct/nite/fd2log& .sp .in .H 1 "Fixing corrupted files" .P Unfortunately, this accounting system is not entirely fool proof. Occasionally a file will become corrupted, or lost. Some of the files can simply be ignored or restored from the filesave backup. However, certain files must be fixed in order to maintain the integrity of the accounting system. .P The .B wtmp files seem to cause the most problems in the day to day operation of the accounting system. When the date is changed when \s-1UNIX\s0 is in multi-user mode, a set of date change records is written into .B /usr/adm/wtmp . The .I wtmpfix program is designed to adjust the time stamps in the .B wtmp records when a date change is encountered. Some combinations of date changes and reboots, however, will slip through .I wtmpfix and cause .I acctcon1 to fail. The following steps show how to patch up a .B wtmp file. .B .nf .in +5 .sp cd /usr/adm/acct/nite fwtmp < wtmp.\fI\s-1MMDD\s0\fP > xwtmp ed xwtmp .in +.2i .I delete corrupted records or delete all records from the beginning up to the date change .B .in -.2i fwtmp -ic < xwtmp > wtmp.\fI\s-1MMDD\s0\fP .R .in -5 .fi .P If the .B wtmp file is beyond repair, create a null .B wtmp file. This will prevent any charging of connect time. .I Acctprc1 won't be able to determine which login owned a particular process, but it will be charged to the login that is first in the password file for that userid. .P If the installation is using the accounting system to charge users for system resources, the integrity of .B sum/tacct is quite important. Occasionally, mysterious .B tacct records will appear with negative numbers, duplicate userids, or a userid of 65535. First check .B sum/tacctprev with .I prtacct . If it looks ok, the latest .B sum/tacct.\fI\s-1MMDD\s0\fP should be patched up, then .B sum/tacct recreated. A simple patchup procedure would be: .nf .B .in +5 .sp cd /usr/adm/acct/sum acctmerg -v < tacct.\fI\s-1MMDD\s0\fP > xtacct ed xtacct .in +.2i .I remove the bad records write duplicate uid records to another file .B .in -.2i acctmerg -i < xtacct > tacct.\fI\s-1MMDD\s0\fP acctmerg tacctprev < tacct.\fI\s-1MMDD\s0\fP > tacct .in -5 .R .fi .P Remember that the .I monacct procedure removes all the .B tacct.\fI\s-1MMDD\s0\fP files; therefore, .B sum/tacct can be recreated by merging these files together. .H 1 "Recompiling pnpsplit" .P The .I pnpsplit subroutine is used by .I acctcon1 and .I acctprc1 to determine the difference between prime and non-prime time. Prime time is defined as 9 a.m. to 5 p.m. Monday through Friday, holidays excluded. Every year on the day after Christmas, the following message will appear in .B log : .sp .B ~~~~~\(**\(**\(**~\s-1RECOMPILE\s0~pnpsplit~\s-1WITH\s0~\s-1NEW\s0~\s-1HOLIDAYS\s0~\(**\(**\(** .sp .P Unfortunately, this will cause .I runacct to fail until .I pnpsplit , .I acctcon1 , and .I acctprc1 are recompiled. The following steps should be taken to successfully recompile these programs. .AL 1 .LI Edit .B pnpsplit.c to change the .B thisyear variable to the new year. Update the .B holidays array to reflect the new holidays. .B Pnpsplit.c is in .B /usr/src/cmd/acct/lib . .LI Recompile the accounting library .I a.a , .I acctprc1 , and .I acctcon1 by: .sp .I .in +5 super-user to root .B .br cd /usr/src .br \s-1ARGS\s0="library acctcon1 acctprc1" ./:mkcmd acct .in .R .H 1 "Summary" .P The P\s-1WB\s0/\s-1UNIX\s0 accounting system was designed from a \s-1UNIX\s0 system administrator's point of view. Every possible precaution has been taken to ensure that the system will run smoothly and without error. It is important to become familiar with the C programs and shell procedures. The manual pages should be studied, and it is advisable to keep a printed copy of the shell procedures handy. This accounting system should be easy to maintain, provide valuable information for the administrator, and provide accurate breakdowns of the usage of system resources for charging purposes. .SG hsm .NS 1 A. P. Boysen H. T. Gibson M. Petrella A. Petruccelli A. J. Vandenberg R. A. Waskis O. Wathington Members of \s-1RSSG\s0 Dept. 3784 .NE .CS .PH "''''" .OH "'\s9\f2\*(:?\fP'Attachement 1'\\\\n%\s0'" .EH "'\s9\\\\n%'Attachement 1'\f2\*(:?\^\fP\s0'" .if \n% .bp 1 .tr ~ .HU "Files in the \fB/usr/adm\fP directory" .VL 20 4 .LI \fBdiskdiag\fP diagnostic output during the execution of disk accounting programs .LI \fBdtmp\fP output from the .I acctdusg program .LI \fBfee\fP output from the .I chargefee program, \s-1ASCII\s0 tacct records .LI \fBpacct\fP active process accounting file .LI \fBpacct\fI?\fR process accounting files switched via .I turnacct .LI \fBSpacct\fI?.\s-1MMDD\s0\fR process accounting files for .I \s-1MMDD\s0 during execution of .I runacct .LI \fBwtmp\fP active wtmp file for recording connect sessions .LE .HU "Files in the \fB/usr/adm/acct/nite\fP directory" .VL 20 4 .LI \fBactive\fP used by .I runacct to record progress and print warning and error messages. .B active\fI\s-1MMDD\s0\fP same as .B active after .I runacct detects an error .LI \fBcms\fP \s-1ASCII\s0 total command summary used by .I prdaily .LI \fBctacct.\fIMMDD\fR connect accounting records in .I tacct.h format .LI \fBctmp\fP output of .I acctcon1 program, connect session records in .I ctmp.h format .LI \fBdaycms\fP \s-1ASCII\s0 daily command summary used by .I prdaily .LI \fBdaytacct\fP total accounting records for one day in .I tacct.h format .LI \fBdisktacct\fP disk accounting records in .I tacct.h format, created by .I dodisk procedure .LI \fBfd2log\fP diagnostic output during execution of runacct .br ( see cron entry ) .LI \fBlastdate\fP last day .I runacct executed in .B date~+%m%d format .LI \fBlock~lock1\fP used to control serial use of .I runacct .LI \fBlineuse\fP tty line usage report used by .I prdaily .LI \fBlog\fP diagnostic output from .I acctcon1 .LI \fBlog\fI\s-1MMDD\s0\fR same as .B log after .I runacct detects an error .LI \fBreboots\fP contains beginning and ending dates from .B wtmp , and a listing of reboots .LI \fBstatefile\fP used to record current state during execution of .I runacct .LI \fBtmpwtmp\fP wtmp file corrected by .I wtmpfix .LI \fBwtmperror\fP place for .I wtmpfix error messages .LI \fBwtmperror\fI\s-1MMDD\s0\fR same as .B wtmperror after .I runacct detects an error .LI \fBwtmp.\fI\s-1MMDD\s0\fR previous day's wtmp file .LE .HU "Files in the \fB/usr/adm/acct/sum\fP directory" .VL 20 4 .LI \fBcms\fP total command summary file for current fiscal in internal summary format .LI \fBcmsprev\fP command summary file without latest update .LI \fBdaycms\fP command summary file for yesterday in internal summary format .LI \fBloginlog\fP created by .I lastlogin .LI \fBpacct.\fI\s-1MMDD\s0\fR concatenated version of all pacct files for .I \s-1MMDD\s0 , removed after reboot by .I remove procedure .LI \fBrprt.\fI\s-1MMDD\s0\fR saved output of .I prdaily program .LI \fBtacct\fP cumulative total accounting file for current fiscal .LI \fBtacctprev\fP same as .B tacct without latest update .LI \fBtacct.\fI\s-1MMDD\s0\fR total accounting file for .I \s-1MMDD\s0 .LI \fBwtmp.\fI\s-1MMDD\s0\fR saved copy of wtmp file for .I \s-1MMDD\s0 , removed after reboot by .I remove procedure .LE .HU "Files in the \fB/usr/adm/acct/fiscal\fP directory" .VL 20 4 .LI \fBcms\fI?\fR total command summary file for fiscal \fI?\fP in internal summary format .LI \fBfiscrpt\fI?\fR report similar to .I prdaily for fiscal \fI?\fP .LI \fBtacct\fI?\fR total accounting file for fiscal \fI?\fP .LE .PH "''''" .OH "'\s9\f2\*(:?\fP'Attachment 2'\\\\n%\s0'" .EH "'\s9\\\\n%'Attachment 2'\f2\*(:?\^\fP\s0'" .if \n% .bp 1 .HU "Format of wtmp files (utmp.h)" .DS /\(** \(** Format of /etc/utmp and /usr/adm/wtmp \(**/ struct utmp { char ut_line[8]; /\(** tty name \(**/ char ut_name[8]; /\(** user id \(**/ long ut_time; /\(** time on \(**/ }; .DE .HU "Definitions (acctdef.h)" .DS /\(** \(** defines, typedefs, etc. used by acct programs \(**/ /\(** \(** following taken from (or modified versions of) <sys/types.h> \(**/ typedef unsigned short dev_t; typedef unsigned int ino_t; typedef long off_t; typedef long time_t; /\(** \(** acct only typedefs \(**/ typedef unsigned short uid_t; #define LSZ 8 /\(** sizeof line name \(**/ #define NSZ 8 /\(** sizeof login name \(**/ #define P 0 /\(** prime time \(**/ #define NP 1 /\(** nonprime time \(**/ /\(** \(** limits which may have to be increased if systems get larger \(**/ #define SSIZE 1000 /\(** max number of sessions in 1 acct run \(**/ #define TSIZE 100 /\(** max number of line names in 1 acct run \(**/ #define USIZE 500 /\(** max number of distinct login names in 1 acct run \(**/ #define EQN(s1, s2) (strncmp(s1, s2, sizeof(s1)) == 0) #define CPYN(s1, s2) strncpy(s1, s2, sizeof(s1)) #define SECS(tics) ((double) tics)/60. #define MINS(secs) ((double) secs)/60. #define MINT(tics) ((double) tics)/3600. #define KCORE(clicks) ((double) clicks/16) #define SECSINDAY 86400L .DE .SK .HU "Format of pacct files (acct.h)" .DS /\(** \(** Accounting structures \(**/ typedef unsigned short comp_t; /\(** "floating point" \(**/ struct acct { char ac_flag; /\(** Accounting flag \(**/ char ac_stat; /\(** Exit status \(**/ short ac_uid; /\(** Accounting user ID \(**/ short ac_gid; /\(** Accounting group ID \(**/ dev_t ac_tty; /\(** control typewriter \(**/ time_t ac_btime; /\(** Beginning time \(**/ comp_t ac_utime; /\(** Accounting user time \(**/ comp_t ac_stime; /\(** Accounting system time \(**/ comp_t ac_etime; /\(** Accounting elapsed time \(**/ comp_t ac_mem; /\(** memory usage \(**/ comp_t ac_io; comp_t ac_rw; char ac_comm[8]; /\(** command name \(**/ }; extern struct acct acctbuf; extern struct inode \(**acctp; /\(** inode of accounting file \(**/ #define AFORK 01 /\(** has executed fork, but no exec \(**/ #define ASU 02 /\(** used super-user privileges \(**/ #define ACCTF 0300 /\(** record type: 00 = acct \(**/ .DE .HU "Format of tacct files (tacct.h)" .DS /\(** \(** total accounting (for acct period), also for day \(**/ struct tacct { uid_t ta_uid; /\(** userid \(**/ char ta_name[8]; /\(** login name \(**/ float ta_cpu[2]; /\(** cum. cpu time, p/np (mins) \(**/ float ta_kcore[2]; /\(** cum kcore-minutes, p/np \(**/ float ta_con[2]; /\(** cum. connect time, p/np, mins \(**/ float ta_du; /\(** cum. disk usage \(**/ long ta_pc; /\(** count of processes \(**/ unsigned short ta_sc; /\(** count of login sessions \(**/ unsigned short ta_dc; /\(** count of disk samples \(**/ unsigned short ta_fee; /\(** fee for special services \(**/ }; .DE .HU "Format of ctmp file (ctmp.h)" .DS /\(** \(** connect time record (various intermediate files) \(**/ struct ctmp { dev_t ct_tty; /\(** major minor \(**/ uid_t ct_uid; /\(** userid \(**/ char ct_name[8]; /\(** login name \(**/ long ct_con[2]; /\(** connect time (p/np) secs \(**/ time_t ct_start; /\(** session start time \(**/ }; .DE .PH "''''" .OH "'\s9\f2\*(:?\fP'Attachement 3'\\\\n%\s0'" .EH "'\s9\\\\n%'Attachement 3'\f2\*(:?\^\fP\s0'" .if \n% .bp 1 .de dS .DS .ps 6 .vs 7p .. .de dE .ps 10 .vs 12p .DE .. .dS Jun 8 04:14 1979 DAILY REPORT FOR pwba Page 1 from Thu Jun 7 06:00:48 1979 to Fri Jun 8 04:00:28 1979 2 shutdown 2 pwba TOTAL DURATION IS 1320 MINUTES .TS l c c c c c l n n n n n. LINE MINUTES PERCENT # SESS # ON # OFF tty04 479 36 9 9 30 tty47 341 26 4 4 33 tty44 298 23 3 3 29 tty46 336 25 9 9 33 console 1100 83 14 14 21 tty05 448 34 3 3 22 tty06 439 33 9 9 31 tty07 421 32 6 6 24 tty42 53 4 5 5 20 tty09 385 29 11 11 33 tty10 336 25 10 10 31 tty08 464 35 2 2 19 tty26 544 41 6 6 24 tty12 252 19 5 5 25 tty13 258 20 3 3 21 tty14 156 12 6 6 26 tty17 145 11 1 1 16 tty18 39 3 5 5 24 tty15 228 17 5 5 25 tty25 704 53 6 6 25 tty21 0 0 0 0 16 tty19 10 1 1 1 17 tty20 25 2 2 2 18 tty22 0 0 0 0 15 tty23 0 0 0 0 15 tty24 0 0 0 0 16 tty27 481 36 3 3 20 tty28 426 32 5 5 24 tty29 302 23 6 6 25 tty30 257 20 11 11 28 tty40 380 29 5 5 21 tty41 343 26 3 3 21 tty45 0 0 0 0 15 tty11 365 28 7 7 25 tty43 3 0 1 1 17 tty16 213 16 3 3 20 tty31 250 19 4 4 18 tty02 62 5 1 1 3 TOTALS 10544 -- 174 174 846 .TE .dE .bp .dS Jun 8 04:14 1979 DAILY USAGE REPORT FOR pwba Page 1 .TS l l c s c s c s l l l l l l l l l l l l l l l l l l l l n n n n n n n n n n n. LOGIN CPU (MINS) KCORE-MINS CONNECT (MINS) DISK # OF # OF # DISK FEE UID NAME PRIME NPRIME PRIME NPRIME PRIME NPRIME BLOCKS PROCS SESS SAMPLES \& 0 TOTAL 388 103 12414 2934 9251 1056 0 16164 174 0 0 0 root 47 41 1003 924 67 30 0 2360 8 0 0 4 adm 7 19 48 652 0 0 0 842 0 0 0 19 games 0 0 4 0 0 0 0 28 0 0 0 22 mhb 0 0 1 1 1 1 0 14 2 0 0 37 abs 0 0 4 0 0 0 0 3 0 0 0 37 absjrk 14 0 284 0 423 0 0 1588 4 0 0 68 rje 3 3 24 21 0 0 0 179 0 0 0 71 ? 0 0 0 0 0 0 0 12 0 0 0 150 jac 7 0 156 5 281 2 0 510 13 0 0 173 ? 0 0 0 0 0 0 0 16 0 0 0 180 ? 0 0 0 0 0 0 0 4 0 0 0 185 ? 0 0 0 0 0 0 0 2 0 0 0 217 denise 0 0 2 0 31 0 0 32 3 0 0 217 kof 0 0 2 0 1 0 0 7 1 0 0 219 ? 0 0 0 0 0 0 0 12 0 0 0 1001 hsm 5 0 189 0 179 0 0 92 2 0 0 2001 systst 0 1 5 28 476 64 0 99 5 0 0 2002 mfp 1 0 7 5 270 62 0 93 3 0 0 2003 als 1 0 23 0 100 0 0 99 3 0 0 2005 eric 0 0 3 0 13 0 0 21 1 0 0 2006 hoot 0 0 2 0 16 0 0 8 1 0 0 2009 agp 47 0 2040 0 444 0 0 492 2 0 0 2009 fsrep1 2 0 60 0 36 0 0 95 1 0 0 2011 pdw 0 0 1 0 4 0 0 11 1 0 0 2012 pwbst 0 0 1 0 28 0 0 9 1 0 0 2014 cath 0 0 1 0 1 0 0 7 1 0 0 2022 rem 32 1 1227 91 576 4 0 226 3 0 0 2025 fld 55 23 2176 862 336 98 0 750 7 0 0 2027 krb 14 2 365 51 547 24 0 372 8 0 0 2028 text 0 0 1 0 3 0 0 13 1 0 0 2030 arf 8 0 288 0 317 0 0 315 3 0 0 2031 dp 12 0 480 3 459 6 0 220 6 0 0 2032 graf 2 0 49 0 23 0 0 118 1 0 0 2033 ecp 3 0 74 0 355 0 0 115 4 0 0 2040 leap 15 0 308 0 513 1 0 505 2 0 0 2041 dan 3 0 93 3 149 2 0 117 8 0 0 2051 ds52 2 2 19 40 375 601 0 611 8 0 0 2055 nuucp 0 0 15 9 17 1 0 10 3 0 0 2057 ech 1 0 28 0 63 0 0 68 2 0 0 2061 jcw 4 3 99 70 37 34 0 869 4 0 0 2064 mjr 18 0 443 0 176 0 0 2065 3 0 0 2065 rrr 0 0 6 0 7 0 0 23 1 0 0 2068 trc 0 0 7 0 10 0 0 29 1 0 0 2075 herb 29 0 1178 1 384 2 0 249 5 0 0 2086 paul 1 0 14 0 152 0 0 28 1 0 0 2087 pris 0 0 0 10 0 2 0 13 1 0 0 2111 pwbcs 2 3 60 85 64 86 0 185 4 0 0 2116 rbj 1 0 16 0 408 0 0 222 1 0 0 2121 teach 0 0 3 0 53 0 0 50 2 0 0 2123 msb 0 0 3 0 5 0 0 24 1 0 0 2124 rnt 2 0 42 0 66 0 0 260 3 0 0 2126 dal 0 0 5 0 121 0 0 17 1 0 0 2127 m2 15 0 495 11 390 2 0 602 10 0 0 .T& l s s s s s s s s s s s s l l n n n n n n n n n n n. Jun 8 04:14 1979 DAILY USAGE REPORT FOR pwba Page 2 2128 jel 14 0 492 9 422 14 0 523 8 0 0 2130 s1 0 0 5 1 16 0 0 42 2 0 0 2130 s3 0 0 0 0 0 2 0 9 1 0 0 2135 jfn 0 1 0 12 0 11 0 33 2 0 0 2136 m2class 0 0 5 0 2 0 0 18 1 0 0 2140 star 4 0 213 12 90 3 0 170 7 0 0 2141 reg 5 0 245 25 470 4 0 181 1 0 0 2199 llc 0 0 1 0 10 0 0 7 1 0 0 2999 stock 0 0 1 0 1 0 0 17 1 0 0 3001 whm 5 0 93 0 253 0 0 414 3 0 0 3332 vjf 0 0 4 0 8 0 0 39 1 0 0 .TE .dE .bp .dS Jun 8 04:07 1979 DAILY COMMAND SUMMARY Page 1 .TS l c c c c c c c c c l c c c c c c c c c l n n n n n n n n n. COMMAND NUMBER TOTAL TOTAL TOTAL MEAN MEAN HOG CHARS BLOCKS NAME CMDS KCOREMIN CPU-MIN REAL-MIN SIZE-K CPU-MIN FACTOR TRNSFD READ TOTALS 16164 15332.89 490.72 37463.98 31.25 0.03 0.01 322183844 1097670 nroff 119 3958.68 93.21 569.83 42.47 0.78 0.16 67070052 130284 troff 26 2483.38 51.63 342.70 48.10 1.99 0.15 37869304 48989 xnroff 20 732.03 16.74 111.05 43.73 0.84 0.15 13885248 22659 a.out 31 623.53 10.52 142.77 59.26 0.34 0.07 382435 2758 egrep 185 574.83 13.96 34.53 41.18 0.08 0.40 170625 8249 m2find 232 555.79 9.93 155.11 55.96 0.04 0.06 6155937 30994 c1 150 519.04 13.57 48.89 38.25 0.09 0.28 4285724 16032 c0 165 413.10 9.19 35.16 44.93 0.06 0.26 3827309 12170 m2edit 33 340.92 4.63 148.27 73.62 0.14 0.03 1074914 14492 ld 87 317.38 7.94 38.48 39.97 0.09 0.21 17640896 45797 acctcms 17 294.75 6.49 14.15 45.41 0.38 0.46 2525427 5515 c2 112 289.69 9.13 34.61 31.72 0.08 0.26 3667050 9681 sh 1834 276.98 26.77 20444.24 10.35 0.01 0.00 3496613 71979 ed 524 253.13 14.46 2029.89 17.50 0.03 0.01 18058108 56039 acctprc1 3 231.28 6.67 19.45 34.67 2.22 0.34 2577344 2926 du 145 219.35 19.91 39.08 11.02 0.14 0.51 716389 23695 diff 49 175.53 6.04 25.78 29.05 0.12 0.23 3740887 11351 get 151 152.96 4.28 25.23 35.74 0.03 0.17 3634042 24917 adb 22 148.10 4.07 202.35 36.37 0.19 0.02 2313718 9813 tbl 24 143.43 2.44 210.65 58.71 0.10 0.01 1536210 3433 dd 9 139.24 10.15 51.05 13.72 1.13 0.20 26006848 294 as2 155 129.33 9.82 42.25 13.17 0.06 0.23 10500835 30165 sed 597 115.46 4.19 36.23 27.57 0.01 0.12 783825 24497 ps 51 109.69 5.92 41.55 18.54 0.12 0.14 2278056 8310 make 89 102.94 2.87 203.32 35.81 0.03 0.01 1018461 8664 delta 25 90.23 2.27 17.80 39.70 0.09 0.13 2909269 9321 cpp 172 89.37 2.69 11.32 33.19 0.02 0.24 3519054 12155 fsck 16 86.94 1.30 10.57 66.85 0.08 0.12 27671849 2927 find 52 86.64 5.05 63.87 17.15 0.10 0.08 565125 11161 ls 706 82.47 5.78 62.85 14.26 0.01 0.09 1811882 29659 xck 2 79.44 10.49 47.89 7.57 5.25 0.22 198016 21995 awk 22 78.83 1.37 5.24 57.72 0.06 0.26 355466 3769 uucico 60 75.55 1.42 632.50 53.27 0.02 0.00 398693 6377 acctcom 9 75.21 2.81 11.49 26.75 0.31 0.24 1283776 3771 echo 2814 66.10 7.08 91.80 9.33 0.00 0.08 168651 24253 ged 3 57.27 0.82 7.51 70.16 0.27 0.11 51832 426 dc 284 56.92 2.42 9.43 23.48 0.01 0.26 15283 20329 450 7 48.03 6.80 84.45 7.06 0.97 0.08 279451 1700 cat 749 45.49 5.69 478.54 8.00 0.01 0.01 8959500 27903 ntd 6 41.52 1.55 7.55 26.87 0.26 0.20 59888 478 mail 202 39.95 2.05 532.98 19.53 0.01 0.00 427217 14377 acctprc2 3 38.95 1.43 19.45 27.24 0.48 0.07 587336 87 sort 94 38.72 1.09 9.73 35.41 0.01 0.11 375876 4433 pr 104 34.89 2.47 214.50 14.10 0.02 0.01 1060989 6572 haspmain 7 33.20 5.28 1244.54 6.29 0.75 0.00 63064 36635 ex 17 31.69 0.62 41.04 50.97 0.04 0.02 514624 3593 grep 213 28.73 2.98 21.01 9.64 0.01 0.14 2100229 14297 .TE .dE .bp .dS Jun 8 04:07 1979 MONTHLY TOTAL COMMAND SUMMARY Page 1 .TS l c c c c c c c c c l c c c c c c c c c l n n n n n n n n n. COMMAND NUMBER TOTAL TOTAL TOTAL MEAN MEAN HOG CHARS BLOCKS NAME CMDS KCOREMIN CPU-MIN REAL-MIN SIZE-K CPU-MIN FACTOR TRNSFD READ TOTALS 553286 297698.78 10916.09 742924.94 27.27 0.02 0.01 820472546 26253312 nroff 1687 44681.55 995.92 5737.25 44.86 0.59 0.17 613403153 1089180 troff 1351 25692.15 583.69 4356.05 44.02 0.43 0.13 413163589 646243 spellpro 6466 17298.41 294.16 1893.79 58.81 0.05 0.16 334572640 853901 m2edit 654 13526.69 164.62 4238.58 82.17 0.25 0.04 54940426 427924 xnroff 397 10408.44 203.72 1496.32 51.09 0.51 0.14 215221419 301967 sort 7983 9292.34 226.01 2298.05 41.11 0.03 0.10 80108304 355963 c1 6139 8949.86 236.45 861.09 37.85 0.04 0.27 79897995 489661 ld 3244 8852.96 223.19 1128.09 39.67 0.07 0.20 493701995 1278119 sed 53134 8126.71 313.85 2241.78 25.89 0.01 0.14 23035033 1692990 m2find 2982 7984.45 140.18 1698.25 56.96 0.05 0.08 111330040 449604 c0 6586 7866.42 185.16 725.47 42.49 0.03 0.26 72595655 389426 ed 20083 7822.78 425.90 41898.18 18.37 0.02 0.01 483425634 1541326 tbl 660 7766.69 113.95 2458.55 68.16 0.17 0.05 50760094 83887 sh 40476 7499.67 635.00 383786.53 11.81 0.02 0.00 70525236 1421194 du 1941 6730.54 553.04 1128.44 12.17 0.28 0.49 20848359 628324 a.out 1483 5658.46 126.87 1868.87 44.60 0.09 0.07 16158675 80260 egrep 4801 5573.51 139.86 460.25 39.85 0.03 0.30 6823696 237298 lint1 793 5325.66 71.23 425.67 74.76 0.09 0.17 9599001 131592 cat 21170 4657.53 236.59 4354.24 19.69 0.01 0.05 239180412 1023965 acctprc1 42 3837.84 110.88 291.34 34.61 2.64 0.38 43954136 61123 c2 4067 3807.25 144.86 477.28 26.28 0.04 0.30 57519376 213521 grep 21212 3204.86 300.44 2727.87 10.67 0.01 0.11 139340583 899415 cpp 7469 3060.72 94.12 647.79 32.52 0.01 0.15 91471956 459882 getty 35556 2948.71 853.53 101107.45 3.45 0.02 0.01 34704751 263866 m2editD 83 2707.27 28.79 361.84 94.02 0.35 0.08 2852202 33949 as2 6454 2698.74 218.96 910.59 12.33 0.03 0.24 213336016 705690 make 1858 2449.10 64.69 4388.86 37.86 0.03 0.01 24116259 175544 ps 1034 2384.14 128.29 1207.87 18.58 0.12 0.11 54873792 204172 acctcms 294 2288.36 51.99 116.06 44.01 0.18 0.45 36124940 80523 uucico 815 2226.75 40.42 11729.01 55.08 0.05 0.00 11086105 162558 ls 18876 2170.01 152.76 1538.09 14.20 0.01 0.10 32418106 691028 find 1705 2114.18 114.35 920.75 18.49 0.07 0.12 94631199 338600 ged 72 2026.43 28.54 317.21 71.01 0.40 0.09 1648636 10374 echo 84710 2018.23 190.14 1138.49 10.61 0.00 0.17 2926992 649200 cpio 127 1956.60 77.03 391.45 25.40 0.61 0.20 190822346 296302 maze 8 1620.42 44.80 128.25 36.17 5.60 0.35 120399 212 mail 4735 1474.38 76.92 14262.62 19.17 0.02 0.01 25719618 463748 get 1085 1358.03 37.59 234.97 36.13 0.03 0.16 31540008 178623 acctcom 165 1253.99 47.06 339.34 26.64 0.29 0.14 57405662 68949 yacc 58 1187.17 15.36 36.90 77.31 0.26 0.42 4096070 12093 col 638 1064.40 49.01 2199.00 21.72 0.08 0.02 23835395 16903 line 27184 1036.03 93.14 1941.33 11.12 0.00 0.05 925447 296142 nroff1.2 29 909.83 17.71 56.97 51.38 0.61 0.31 11459920 18802 delta 264 904.54 23.07 254.06 39.21 0.09 0.09 24219141 87164 td 175 886.19 25.74 159.73 34.43 0.15 0.16 1990177 15792 ar 1434 872.65 61.87 309.07 14.11 0.04 0.20 189858731 428871 m2findD 144 864.29 12.54 344.13 68.94 0.09 0.04 1184947 28576 rm 15319 857.97 85.65 754.20 10.02 0.01 0.11 453479 433903 acctdusg 1 819.77 39.30 170.10 20.86 39.30 0.23 1812480 39744 f77pass1 155 779.13 7.97 29.09 97.70 0.05 0.27 990027 34702 diff 786 767.31 32.77 260.27 23.41 0.04 0.13 22940094 97214 .TE .dE .bp .dS Jun 8 04:07 1979 LAST LOGIN Page 1 .TS l l l. 00-00-00 dii 00-00-00 rudd 79-06-08 adm 00-00-00 absadm 00-00-00 s10 79-06-08 agp 00-00-00 absafr 00-00-00 s2 79-06-08 als 00-00-00 abscas 00-00-00 s4 79-06-08 arf 00-00-00 absjcw 00-00-00 s5 79-06-08 cath 00-00-00 abspvg 00-00-00 s6 79-06-08 dal 00-00-00 abstbm 00-00-00 s8 79-06-08 dan 00-00-00 adm94 00-00-00 s9 79-06-08 denise 00-00-00 apb 00-00-00 scbsa 79-06-08 dp 00-00-00 archive 00-00-00 sjm 79-06-08 ds52 00-00-00 asc 00-00-00 srb 79-06-08 ech 00-00-00 badt 00-00-00 sys 79-06-08 ecp 00-00-00 btb 00-00-00 tgp 79-06-08 eric 00-00-00 bvl 00-00-00 tld 79-06-08 fld 00-00-00 bwk 00-00-00 ussc 79-06-08 fsrep1 00-00-00 chicken 00-00-00 uucpa 79-06-08 games 00-00-00 class 00-00-00 uvac 79-06-08 graf 00-00-00 cleary 00-00-00 vav 79-06-08 herb 00-00-00 cs 00-00-00 wdr 79-06-08 hoot 00-00-00 dbs 00-00-00 willa 79-06-08 hsm 00-00-00 deby 00-00-00 zooma 79-06-08 jac 00-00-00 dec 79-06-04 dws 79-06-08 jcw 00-00-00 demo 79-06-04 ewb 79-06-08 jel 00-00-00 dlt 79-06-04 kas 79-06-08 jfn 00-00-00 dmr 79-06-04 satz 79-06-08 kof 00-00-00 docs 79-06-04 uucp 79-06-08 krb 00-00-00 dug 79-06-05 bcm 79-06-08 leap 00-00-00 ellie 79-06-05 lprem 79-06-08 llc 00-00-00 fsrep2 79-06-05 s7 79-06-08 m2 00-00-00 gas 79-06-05 sccs 79-06-08 m2class 00-00-00 graphics 79-06-06 conv 79-06-08 mfp 00-00-00 hjg 79-06-06 dck 79-06-08 mhb 00-00-00 hlb 79-06-06 dmt 79-06-08 mjr 00-00-00 inst 79-06-06 emp 79-06-08 msb 00-00-00 jfm 79-06-06 pah 79-06-08 nuucp 00-00-00 jrh 79-06-06 sync 79-06-08 paul 00-00-00 ken 79-06-06 tad 79-06-08 pdw 00-00-00 lco 79-06-07 ams 79-06-08 pris 00-00-00 learn 79-06-07 bin 79-06-08 pwbcs 00-00-00 lppdw 79-06-07 dgd 79-06-08 pwbst 00-00-00 lrbb 79-06-07 haight 79-06-08 rbj 00-00-00 maj 79-06-07 hasp 79-06-08 reg 00-00-00 mar 79-06-07 jgw 79-06-08 rem 00-00-00 mash 79-06-07 leb 79-06-08 rje 00-00-00 meq 79-06-07 ljk 79-06-08 rnt 00-00-00 mifi 79-06-07 mep 79-06-08 root 00-00-00 mlc 79-06-07 nhg 79-06-08 rrr 00-00-00 mmr 79-06-07 nws 79-06-08 s1 00-00-00 mpf 79-06-07 qtroff 79-06-08 s3 00-00-00 plan 79-06-07 tbm 79-06-08 star 00-00-00 plum 79-06-07 train 79-06-08 stock 00-00-00 pvg 79-06-07 whr 79-06-08 systst 00-00-00 rakesh 79-06-07 wwe 79-06-08 teach 00-00-00 rfg 79-06-08 ? 79-06-08 text 00-00-00 rlc 79-06-08 abs 79-06-08 trc 00-00-00 rrc 79-06-08 absjrk 79-06-08 vjf 79-06-08 whm .TE .dE .sp .I "January 1980"