Operating System - HP-UX
1846765 Members
5136 Online
110256 Solutions
New Discussion

parent process id of zombie process

 
SOLVED
Go to solution
Shivkumar
Super Advisor

parent process id of zombie process

Hi,

Does all the zombie processes has parent process id of 1 ?

Thanks,
Shiv
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: parent process id of zombie process

Hi Shiv:

Stictly speaking a process with a parent pid (ppid) of one is an "orphan".

A zombie (prrocess) is a dead child process that has not yet been "reaped" by its parent. Reaping eliminates the zombie from the process table (which you will remember is limited in size by 'nproc'). This occurs when the parent process examines the child's exit status.

If proper coding techniques are followed, zombies are few and short-lived. The correct methods for 'fork'ing (creating) child processes add code for reaping by either paying attention to a SIGCHLD signal (signaling a child's end); or by explicitly setting SIGCHLD to IGNORE before forking a child.

It is a parent process's responsiblity to clean-up (reap) its dead children. The death of a parent before its children leads to 'orphan' processes where the orphan's parent becomes 'init'.

Regards!

...JRF...
Arunvijai_4
Honored Contributor

Re: parent process id of zombie process

Hi Shiv,

Here are some good links to read,

http://aplawrence.com/SCOFAQ/FAQ_scotec6cantkill.html

http://en.wikipedia.org/wiki/Zombie_process


A zombie process is not the same as an orphan process. Orphan processes don't become zombie processes; instead, they are adopted by init (process ID 1), which waits on its children.


-Arun
"A ship in the harbor is safe, but that is not what ships are built for"