Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!aecom!naftoli From: naftoli@aecom.UUCP (Robert N. Berlinger) Newsgroups: net.unix,net.bugs.usg Subject: Bug in System V relating to accounting Message-ID: <2481@aecom.UUCP> Date: Wed, 7-May-86 12:06:46 EDT Article-I.D.: aecom.2481 Posted: Wed May 7 12:06:46 1986 Date-Received: Thu, 8-May-86 05:57:27 EDT Distribution: net Organization: Albert Einstein Coll. of Med., NY Lines: 34 Xref: linus net.unix:7138 net.bugs.usg:448 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