|
In the old days, we had directly attached dumb terminals that we used. A program called getty would initialize the port, print a login prompt and read a login name. If that read ever succeded, it would exec login which would get your password and then then exec your shell. When your shell exited, init would notice and respawn a new getty.
The getty program would clear out a utmp entry. The login program would put the user's info in the utmp entry.
So you never had these leftovers. If the system rebooted or if if your shell died, a new getty would come along and clear out the utmp entry.
Then came networks. Now we have telnetd (or something similiar) that creates the utmp entry and then forks and exec's login. The telnetd, besides handling the communication, is waiting for the shell to exit. When it does, telnetd will clear out that utmp entry.
But if the telnetd is killed with -9 or if the system reboots unexpectedly with users still logged in, the entry in utmp persists. Eventually, the pty will be re-used and entry re-used as well. But in the meantime the old entries continue to show up in "who".
You could clear the file out at reboot time if it really bothers you. I see it as a resource. Each such entry is evidence of something that went wrong.
|