Computing.Net > Forums > Solaris > How to kill defunct processes

How to kill defunct processes

Reply to Message Icon

Original Message
Name: PVH
Date: November 2, 2001 at 13:12:54 Pacific
Subject: How to kill defunct processes
Comment:

I was wondering as to how do I kill defunct processes in Solaris 7 without rebooting the system. Any help would be appreciated.

Regards,
PVH.


Report Offensive Message For Removal


Response Number 1
Name: danny
Date: November 3, 2001 at 11:37:24 Pacific
Subject: How to kill defunct processes
Reply: (edit)

with the "kill ##" command, where ## is the PID.


Report Offensive Follow Up For Removal

Response Number 2
Name: Mark M
Date: November 26, 2001 at 22:07:07 Pacific
Subject: How to kill defunct processes
Reply: (edit)

Or if it's really stubborn you might have give it a bit of a harder kick.... if a process is really locked up and won't die, you can try a kill -9 xxx (where xxx = PID)

Obviously you find the process you want to kill with ps -ef but be careful :o) I've seen people make typos and killa process with a shedload of children..oops.


Report Offensive Follow Up For Removal

Response Number 3
Name: ChrisB
Date: December 11, 2001 at 08:16:38 Pacific
Subject: How to kill defunct processes
Reply: (edit)

Run:

ps -ef

or ps -ef | grep "process name"

find the process ID number:

root 26900 198 0 Dec 10 ? 0:00

The process id in this example is 26900

Use the kill -9 "process id"

Any further questions just let me know.


Report Offensive Follow Up For Removal

Response Number 4
Name: Me
Date: December 19, 2001 at 06:31:49 Pacific
Subject: How to kill defunct processes
Reply: (edit)

defunct processes can't be killed since they are already dead. To make them disappear you have to kill their parent process...


Report Offensive Follow Up For Removal

Response Number 5
Name: Questmaker
Date: February 4, 2002 at 00:56:44 Pacific
Subject: How to kill defunct processes
Reply: (edit)

So, the nxt question is:

How do you find the parent process for a process?


Report Offensive Follow Up For Removal


Response Number 6
Name: Rajah
Date: February 4, 2002 at 14:05:43 Pacific
Subject: How to kill defunct processes
Reply: (edit)

Can anybody explain how these defunct processes are created? I'm facing a problem because of these defunct processes. It is noe allowing any of my cgi applications to run.


Report Offensive Follow Up For Removal

Response Number 7
Name: Gerald
Date: April 15, 2002 at 03:53:07 Pacific
Subject: How to kill defunct processes
Reply: (edit)

It's not possible to kill defunct processes.

A good way to kill lists of processes is

ps -ef | grep name_of_process | awk '{print "kill -9 ",$2}' | ksh

A way to find the parent process of defunct processes is

ps -ef | grep defunct | awk '{print "kill -9 ",$3}'

Probably the first search will destroy the parent of all defunct processes and recursive subcalls will produce an error because neither the child nor the parent does not exist anymore after deleting the first found parent.

You should not pipe the output to ksh you should pipe it into a file an manual edit the file because the admin should know what to delete.


Report Offensive Follow Up For Removal

Response Number 8
Name: David Jackson
Date: April 17, 2002 at 16:51:05 Pacific
Subject: How to kill defunct processes
Reply: (edit)

The process is defunct and cannot be killed until the parent process is killed. The process is becoming defunct because it has a FILEHANDLE open at the time the parent is closing.

The parent process ID can be found by:

ps -fe | grep somedefunctprocess | awk '{print $3}'

Be sure you are closing filehandles and doing proper cleanup at the end of your scripts or programs.


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: How to kill defunct processes

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge