[net.bugs.usg] Bug in System V relating to accounting

naftoli@aecom.UUCP (Robert N. Berlinger) (05/07/86)

I have recently found a bug relating to System V accounting.
Consider the following scenario:

1.  User 'a' logs out at 10pm.  A new getty is spawned for the 
    tty and hangs around waiting for next lucky soul to come 
    along.  

2.  User 'b' comes in at 9am the next morning and logs in to the 
    same tty.  He logs out five minutes later.  

3.  User 'b' comes to me the next morning.  He's noticed that he 
    has some non-prime cpu charges, even though he never logged in 
    at night.  

I did a little research and found the problem.  The "start time" 
of his shell was 10pm, the night before, and therefore got 
charged for the cpu of his shell as if he was on all night (as 
far as p/np goes).  This is because 'exec' does not reset the 
start time to the current time, and user b's shell is the same 
process as the getty that was started the night before.  

This is somewhat of a philosophical problem.  Should the start 
time be the creation time of the process (i.e., pid), or should 
it be the time of the most recent 'exec'?  

In any case, it's a bug in System V accounting, and the same 
problem might exist in 4.2BSD.  

Suggested fixes (other than major mods to getty to make it fork, 
I can't even think of the ramifications of that one...) would be 
welcome.  
-- 
Robert Berlinger
...{philabs,cucard,pegasus,ihnp4,rocky2}!aecom!naftoli

narayan@wg3b20.UUCP (05/16/86)

Just use the -t flag to getty in the inittab file

eg.

02:2:respawn:/etc/getty -t60 tty02 9600


This forces a new getty every minute on that line.
It is a not a very clean work around. But it would
do the trick.
-- 

Narayan Mohanram

Phone:		415-962 7170
ARPANET		wg3b20!narayan@lll-tis-b.ARPA
Usenet		ihnp4!{amdahl,pesnta}!wg3b20!narayan
Mail		The Wollongong Group
		1129 San Antonio Road
		Palo Alto, CA 94303. USA



	=========================================================
	||	If you can't lick it, try some whipped cream	||
	=========================================================