LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-03-2012, 01:17 AM   #1
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Rep: Reputation: 0
Exclamation How to find zombie process


How to find a zombie process and then the parent process of that zombie process, so that we can kill it
 
Old 05-03-2012, 01:21 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,524

Rep: Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224Reputation: 1224
Hey guy,
I wrote your question in google "How to find zombie process" and opened the first link. You will find all the answers also...
 
Old 05-03-2012, 01:21 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by abhinav4 View Post
How to find a zombie process and then the parent process of that zombie process, so that we can kill it
In general: Zombie (defunct) processes cannot be killed, you need to reboot to get rid of them.

Most (if not all) of the time a zombie process has lost its "real" parent and is given to/handled by init (process no 1 or 0).

Have a look here: Zombie process

Hope this helps.
 
Old 05-03-2012, 01:31 AM   #4
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Exclamation

Quote:
Originally Posted by pan64 View Post
Hey guy,
I wrote your question in google "How to find zombie process" and opened the first link. You will find all the answers also...
I know how to find a zombie process. What i am asking here is how to get the parent process of that zombie process.
Please read the message fully first.
 
Old 05-03-2012, 01:35 AM   #5
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
I can get the zombie process id by

ps aux

and then looking for z in STAT column. Now how do I get the parent process id corresponding to that id.
 
Old 05-03-2012, 01:44 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Zombie is a child process that is lingering without its parent. As said you would not be able to find its parent as its already dead.
 
Old 05-03-2012, 02:03 AM   #7
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by linuxlover.chaitanya View Post
Zombie is a child process that is lingering without its parent. As said you would not be able to find its parent as its already dead.
I think the process which is without parent is an orphan process not a zombie process. So zombie process does have a parent.
For reference.

http://www.linuxquestions.org/questi...rocess-794531/
 
Old 05-03-2012, 02:23 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Sorry I went the other way. But as mentioned, kill command does not have effect on zombie as on normal process.
 
Old 05-03-2012, 02:33 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by abhinav4 View Post
So zombie process does have a parent.
Yes it does have a parent: init (pid 0 or 1), as mentioned in post #3.
 
Old 05-03-2012, 02:35 AM   #10
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Ok lets take this in more simple way.

How can I get the "ppid" of ANY "pid". I am fetching the "pid" from "ps aux" and NOT "ps ef"
 
Old 05-03-2012, 02:50 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by abhinav4 View Post
How can I get the "ppid" of ANY "pid". I am fetching the "pid" from "ps aux" and NOT "ps ef"
ps aux doesn't include the parent pid (ppid), have a look at this:
Code:
ps axo pid,ppid,stat,comm
Column 1 -> PID
Column 2 -> PPID
Column 3 -> State
Column 4 -> Command

Hope this helps.
 
Old 05-03-2012, 03:07 AM   #12
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
This helped me. Thanks druuna
 
Old 05-03-2012, 03:51 AM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
You're welcome
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zombie process awanish.tiwari Linux - Newbie 5 01-21-2011 12:45 PM
zombie process sang_froid Linux - Server 1 05-25-2010 08:23 AM
Zombie Process N|k0N Linux - Security 8 09-22-2007 02:01 AM
Zombie process - gnomerc Artik Mandriva 0 05-10-2005 01:45 AM
zombie process ihatecomputers Linux - Software 2 03-24-2005 07:09 AM


All times are GMT -5. The time now is 07:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration