Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-09-2007, 08:28 AM
|
#1
|
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Rep:
|
Unable to kill <defunct>
Hi All,
When I run 'ps -e | grep defunct' I get this:
[root@stk-srv01 scripts]# ps -e | grep defunct
1659 ? 00:00:00 sh <defunct>
14071 ? 00:00:00 sh <defunct>
28954 ? 00:00:00 sh <defunct>
I tried to run 'kill -9 [pid#]' and they dont go away. Is there any way to get rid of these processes?
Thanks,
Harlin
|
|
|
|
09-09-2007, 12:20 PM
|
#2
|
|
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450
Rep:
|
These zombie processes are for most intents and purposes “finished” execution. The only reason one may still be in the process table is that the parent has not yet wait()ed for it. This usually means the parent has a bug or is in an exceptional state. The only way to kill the zombie process is to kill its parent.
Last edited by osor; 09-10-2007 at 11:01 AM.
Reason: clarify wait() behavior
|
|
|
|
09-09-2007, 12:55 PM
|
#3
|
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Original Poster
Rep:
|
Is there a quick way to find the parent?
Thanks,
Harlin
|
|
|
|
09-09-2007, 01:15 PM
|
#4
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,902
|
ps -ef
gives the parent (PPID). But you'll find that those things
are often orphaned as well, and hence owned by init ...
*DON'T* kill process #1 in an attempt to get rid of them ;}
Cheers,
Tink
|
|
|
|
09-09-2007, 02:58 PM
|
#5
|
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Original Poster
Rep:
|
Fair enough. Thanks for the help though.
Harlin
|
|
|
|
09-09-2007, 03:06 PM
|
#6
|
|
Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131
Rep: 
|
Quote:
|
*DON'T* kill process #1 in an attempt to get rid of them ;}
|
I think it shouldn't even be possible. There's no sane reason to kill init (any such reason leads to resetting or running shutdown anyway)..
pstree is also a handy tool, try it out - shows processes in a treeview.
Last edited by b0uncer; 09-10-2007 at 11:23 AM.
Reason: fixed an error..
|
|
|
|
09-10-2007, 10:19 AM
|
#7
|
|
Member
Registered: Dec 2005
Distribution: RedHat, Ubuntu
Posts: 101
Rep:
|
tiny clarificationn on "wait()" behaviour...
Quote:
Originally Posted by osor
The only reason they are still in the process table is that the parent is wait()ing for it.
|
I'm not knitpicking; just want to make sure the original poster has it clear...
the zombie proc is laying around because the parent has NOT yet called the wait() system call to syncronize it's execution with the child.
When the parent calls wait(), the child process -- really, one of it's children if it has more than one zombie -- will be cleaned up. Of course, if the parent is buggy, or poorly written, it'll never actually call wait() and you have zombies until you kill the parent (as someone else already pointed out.)
-c
|
|
|
|
09-10-2007, 11:06 AM
|
#8
|
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Original Poster
Rep:
|
No worries... I don't plan on doing an init kill anytime soon. ;-)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:39 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|