Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!dbj.rice@rand-relay From: dbj.rice@rand-relay@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Re: last proc table slot Message-ID: <3768@sri-arpa.UUCP> Date: Wed, 3-Aug-83 05:13:06 EDT Article-I.D.: sri-arpa.3768 Posted: Wed Aug 3 05:13:06 1983 Date-Received: Sat, 6-Aug-83 07:52:07 EDT Lines: 37 From: Dave JohnsonIf all the proc table slots (except one for root) are gone and you log in as root it will probably be a bit hard to do a 'ps' as you just took the one reserved for root when you logged in. You've probably gotten about 3000 replies already that say this, but here goes: When you log on, you don't take up any more proc table slots since there is always a process for each terminal already running waiting for somebody to walk up and type a user name on the terminal. If the terminal is a dialup, this process is hung on the open of the terminal line in init, while if the terminal is hardwired and there is always a carier on the line, the process has execed getty, and the process is hung reading the user name from the terminal. In either case, once you get logged on, this process then execs the shell, so no new process is needed. You still have that spare proc table slot for your "ps" command and then for a "kill" command to kill the offender. Right as you log off, though, the "login" process for that terminal finally exits, and init must fork a new one to take its place. If you ran out of proc table slots just as this was happening, init's fork for this new process would take up the last proc table slot (the one reserved for root) since init runs as root. Even in this case, though, you'd be able to log on since there was a proc table slot left for this process. Then, after getting on, you could exec the "ps" command from your login shell with the "exec" command built in to both the Bourne shell and C-shell. This would, in effect, log you off, but that's no problem -- init would just fire up a new process for that terminal taking the newly vacated process slot (it can take the last slot again since it's running as root), and you just log on again and exec another command the same way. Eventually, you could get in enough commands to find out who is taking up all the proc table slots and do a "kill" command on him. Dave Johnson Dept. of Math Science Rice University dbj.rice@Rand-Relay