Problems with <defunct> processes

Conor P. Cahill cpcahil at virtech.uucp
Fri Jul 13 23:37:02 AEST 1990


In article <6530 at helios.TAMU.EDU> skdutta at cs.tamu.edu (Saumen K Dutta) writes:
>Is there any way to kill a <defunct> process without rebooting the system.

There is no way to get rid of a "defunct" process because the process 
doesn't really exist.  

>What has happened is something like this
>
>In a C program I invoked a background process in some node using rsh.
>
>system("rsh node1 command&");

What is probably causing the defunct here is the rsh command itself.  If 
you run system("some command &"); the system() returns once the shell 
that started your command exits.  Your command is then re-parented to 
init (since it's parent - the shell - has exited).

>This creates a background process and runs the command. After running the
>above file few times I saw that the system is loaded with many unwanted
>processes all of which are swapped to the disk and seems to be waiting
>for some DISK I/O for some unknown reason. The process table shows them
>to be the defunct processes. 

Defunct processes do not get swapped to disk because there is no process
associated with a defunct.  It only takes up a slot in the process 
table to hold some process information (like execution times, exit status,
etc) that is to be returned to its parent.

>I tried to kill them in so many different ways known to me. Is there 
>anybody who can help me to sort out the problem. I want to kill these
>unwanted processes without rebooting the whole system. I need the
>solution urgently.

To fix your problem you need to find out why rsh is leaving the 
defunct processes lying around (i.e why it isn't waiting on the 
processes or why it doesn't just die & go away so init can wait on
them).


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.wizards mailing list