Bug in System V relating to accounting
Robert N. Berlinger
naftoli at aecom.UUCP
Thu May 8 02:06:46 AEST 1986
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
More information about the Comp.unix
mailing list