Subject: >run away processes !

From: [email-masked] (John Andrea)
Date: 15 Feb 95 20:45:55 GMT

In a different group (AIX) I made a contact regarding run away processes
which grab cpu (pine and kermit are the major ones). Here is some
information reprinted with permission.

The author was:
Randolph J. Herber, [email-masked], +1 708 840 2966, CD/HQ
(Speaking for myself and not for US, US DOE, FNAL nor URA.)
(Product, trade, or service marks herein belong to their respective
owners.)

The problem of run-away, CPU gobbling orphan processes is frequently
caused by a program starting a process via a remote connection --- rpc,
ftp, rlogin, telnet, etc. --- and then the connection is broken without
properly terminating the program.  IRIX had been having that problem with
FTPD sessions lately.  I have seen it happen with UUCP connections with
many variants of the UNIX operating system until the connection is timed
out by the uucico program (if it has 10 consecutive timeouts (about 10
seconds each) with failures to respond to a request to respond after each
timeout). 

The reason for the effect of the change from ksh to tcsh has to do with
whether or not the child process is placed in its own process group when
it is started.  There are good arguments both for giving a child process
its own process group and for not giving it its own process group.  I
believe that ksh and tcsh have opposite opinions.  The ksh parameter that
controls this behavior is the `set monitor' which can be set the other way
with `set +m'.  The standard default for interactive kshs is `set
monitor'. I was not able to determine the process group behavior of tcsh. 
Most kernel connection support (terminal I/O drivers, TCP/IP, streams,
etc.) send a SIGHUP to the process group of the process that originally
opened the connection --- the login shell most likely.  If the children
are given their own process group, they are protected from the SIGHUP. 
Many systems give immediate, repetitive returns to select(2) when there is
no apparent connection left (I presume that the process would have gone
away if it had received the SIGHUP) and this can easily consume an entire
CPU. 

The problem with killing orphans is that you do not want to kill legal and
legimate orphans.  You would want to generate a list of program names to
check or ignore. 
--
__________________________________________________________________
John Andrea                         St. Francis Xavier Univ.
University Computer Services        Antigonish, NS, CANADA B2G 2W5
http://www.stfx.ca/jandrea/