The "seat" package provides the bare bones of a method for billing for
seat time at consoles on SGI systems.  Probably it would work with
minor tweaks on other Unix systems as well.  It is composed of the following
parts:

An addition to the /usr/spool/cron/crontabs/root file:

(Note, Digital Unix doesn't like this format, for it, don't use a "\" to 
split the first command, and break the multiline subsequent commands out 
into separate shell scripts.)

#
#
# Implement
# a seat time measuring system by keeping track of how long 4Dwm has a name
# associated with it.
#
# The raw data collector.  Every minute it checks for 4Dwm and appends
# a line, if found, to a seat.log file
#
*	*	*	*	*	ps -ef | grep 4Dwm | \
        grep -v grep >> /var/adm/seat/seat.log
#
# second, at midnight every day sum up the entries in the seat.log file.  This
# deletes the seat.log, but the procedure above will recreate it.  Doing so
# may cause the loss of one minute's accounting around midnight
#
0       0       *       *       *       cd /var/adm/seat; if test -r RAWMINUTE;then cp RAWMINUTE oRAWMINUTE; fi; mv seat.log RAWMINUTE;/usr/local/bin/raw2sum 2> /dev/null
#
# third, convert all of the SUMMINUTE records into a single PAYMINUTE for the
# preceding month. Allow 15 minutes for the second step to complete.
#
15      0       1       *       *       cd /var/adm/seat; if test -r PAYMINUTE; then mv PAYMINUTE PAYMINUTE.last_month;fi;/usr/local/bin/sum2pay 2> /dev/null;mv SUMMINUTE SUMMINUTE.last_month
