Directory acc:

This directory contains programs used at UBC to do accounting, or
accounting file manipulation:

cost.c		print out charge information
getstats.c	collect statistics from process exit information
mkuser.c	make a user account
rdtab.c		utility routine to read /etc/passwd id information
setlimit.c	set a charge limit to an account
scheck.c	icheck-like routine that calculates disk space usage

To use these routines (except mkuser) requires modified versions of

ac.c		to produced elapsed time information
login.c		to invoke /etc/chklimit if a limit exists
		/etc/chklimit is a link to /usr/bin/cost 

Most of these routines need routines from -lw and -lS.

Various accounting files used: (in /usr/adm)
all (except cpu-stats.l) are referenced from "cost"


cpu-stats	keeps the login name, the cpu times, and fork count
cpu-stats.l	limits for money spent, set via setlimit, checked
		via /etc/chklimit
cpu-stats.t	terminal time charges
cpu-stats.s	space integral, updated via scheck
cpu-stats.p	printer usage information (lines, plot lines, pages printed)

Other accounting files:

/etc/passwd	for id, group, etc.
/etc/phonelist	for other information mostly local to UBC
		such as phone number, supervisor, grant number, department
		name etc.

To install the following must be done:

1.	put dmr/stat.c into the system as a character driver
	/etc/mknod /dev/stat0 c x 0
	where x is the minor device number of the stat driver.
	This will allow /dev/stat0 to be used to read accounting
	information.
2.	modify sys1.c with the lines in "sys1.acc"
	via a "sh sys1.acc".
3.	if terminal time charges are required replace ac with the 
	ubc version
4.	if disk space charging is to be done install scheck
	we keep it in /usr/adm/scheck
5.	we have the following lines in /etc/rc to control the
	accounting:

	/usr/adm/wprg < /usr/adm/wtmp >> /usr/adm/wtmp.log ; ac -u 
	long /usr/adm/scheck -u < /etc/userdisks
	/usr/webb/getstats < /dev/stat0 &

	wprg copies the wtmp file onto the end of wtmp.log and deletes
	useless entries. the ac -u moves the terminal charge information
	into cpu-stats.t

	scheck updates the disk charges at boot time. the long is so that
	we can keep a list of disk names in /etc/usersdisks. we don't charge
	ourselves for the root disk and other system disks.

	getstats starts up the cpu stat collection
