LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find zombie process (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-zombie-process-943036/)

abhinav4 05-03-2012 01:17 AM

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

pan64 05-03-2012 01:21 AM

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...

druuna 05-03-2012 01:21 AM

Hi,
Quote:

Originally Posted by abhinav4 (Post 4669085)
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.

abhinav4 05-03-2012 01:31 AM

Quote:

Originally Posted by pan64 (Post 4669088)
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.

abhinav4 05-03-2012 01:35 AM

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.

linuxlover.chaitanya 05-03-2012 01:44 AM

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.

abhinav4 05-03-2012 02:03 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 4669105)
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/

linuxlover.chaitanya 05-03-2012 02:23 AM

Sorry I went the other way. But as mentioned, kill command does not have effect on zombie as on normal process.

druuna 05-03-2012 02:33 AM

Hi,
Quote:

Originally Posted by abhinav4 (Post 4669113)
So zombie process does have a parent.

Yes it does have a parent: init (pid 0 or 1), as mentioned in post #3.

abhinav4 05-03-2012 02:35 AM

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"

druuna 05-03-2012 02:50 AM

Hi,
Quote:

Originally Posted by abhinav4 (Post 4669133)
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.

abhinav4 05-03-2012 03:07 AM

This helped me. Thanks druuna

druuna 05-03-2012 03:51 AM

You're welcome :)


All times are GMT -5. The time now is 11:56 AM.