I have run into the snag of having system processes (such as those
spawned by inetd) fill up all the available PID's. In some cases, I was
running xdm and was able to kill it with CTRL-ALT-BCKSPC to free up a few
PID's in order to log in and fix the problem. In other cases, however, I
have not been so fortunate. In those cases, a trip to the big red help
button was mandated.
I've considered writing a simple PID reservation patch that would
reserve a number of PID's (controlled on the fly by echo'ing an int to
/proc/sys/kernel/reserved-pids) for root use only. It sounds easy enough
to implement. If all non-reserved PID's are in use and a process attempts
to be created under a UID >0, kernel would return EGAIN. This would allow
only root-owned processes to fill the process table. In other cases, the
superuser would be able to log in and fix the problem.
I also considered reserving PID's for processes with a controlling
tty, but I don't think I'll be able to figure out how to do that.
Anyone have thoughts on this?
-bp
-- B. James Phillippe Seattle Software Labs, Inc Network Administrator Phone: (206) 521-8346 NIC Handle: BJP4 Fax: (206) 521-8340 http://w3.terran.org/~bryan http://www.sealabs.com