LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-10-2010, 04:35 PM   #1
rockingb4u
LQ Newbie
 
Registered: Nov 2009
Posts: 16

Rep: Reputation: 0
diffrence between zombie and orphan process


i am bit confused about the two process that is zombie and orphan procees,both is different so what is the exact difference between the two process that makes it different and if there is no parent process then init adopts the children in both the case.so please make me clear
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-10-2010, 04:38 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
An orphan is still executing, a zombie just wont die
 
Old 03-10-2010, 05:36 PM   #3
penguiniator
Member
 
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
http://en.wikipedia.org/wiki/Orphan_process has a short explanation with a link to a similar entry for zombie processes. Their names are quite descriptive.
 
Old 03-10-2010, 10:25 PM   #4
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by rockingb4u
i am bit confused about the two process that is zombie and orphan procees,both is different so what is the exact difference between the two process that makes it different and if there is no parent process then init adopts the children in both the case.so please make me clear
If the child process is dead but its parent process is alive, the child process is declared zombie, means if you run ps aux, you will see that the just died child process is having a Z in the STAT column.

If parent process is dead but its child process is alive, the child process is declared orphan, means it is now adopted by its new parent .. the init process.


Nice link for more clarification:
http://bloggerdigest.blogspot.com/20...n-process.html

Last edited by Aquarius_Girl; 03-10-2010 at 10:32 PM.
 
Old 03-10-2010, 10:57 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,657
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
Here's a good way to think of it...

Zombie: Processes routinely do things by "spawning" child processes and waiting for those child processes to complete. But here's the rub: "Okay, now that the child process has finished executing, how do I get its ending status? If the process is now 'dead and gone,' how do I know what happened to it?"

The solution is: "it becomes a zombie." In other words, the child process is dead, but it is not quite yet gone. It won't disappear until the parent process collects its status. (And the entire reason for the "zombie" status is literally so that it is possible for the parent process to do that.)

---

Orphan: If a parent process dies, but its children have not, then those children are, literally, now "orphans." Linux has to put them somewhere, and what it does is to attach them temporarily as children of "process #1, init," which by definition cannot die. This makes it possible for them to be properly cleaned-up without creating a bunch of weird and messy special cases in the kernel's handling of processes.
 
2 members found this post helpful.
Old 03-10-2010, 11:02 PM   #6
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by sundialsvcs
Zombie: Processes routinely do things by "spawning" child processes and waiting for those child processes to complete. But here's the rub: "Okay, now that the child process has finished executing, how do I get its ending status? If the process is now 'dead and gone,' how do I know what happened to it?"

The solution is: "it becomes a zombie." In other words, the child process is dead, but it is not quite yet gone. It won't disappear until the parent process collects its status. (And the entire reason for the "zombie" status is literally so that it is possible for the parent process to do that.)
Thanks,
That was crystal clear !
 
Old 12-27-2013, 11:28 AM   #7
kmehindru4
LQ Newbie
 
Registered: Dec 2013
Posts: 1

Rep: Reputation: Disabled
ZOMBIE vs ORPHAN process

A zombie is a process when child process completes execution before parent but is not terminated & then child process will be in zombies state where it will not use any resources and show its status as Z+ (Zombie) ,only parent can terminate the child by receiving a exit code .
In orphan process parent finishes execution before child & as to terminate child parent is needed ,which is absent now so child will be allocated a new parent i.e. init ,
any process whose parent is non existing is adopted by the init process whose pid is 1
 
Old 12-27-2013, 08:47 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
To put it in rather graphic terms, parents must reap their dead children, lest they become zombies.
 
  


Reply



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
How to create a c program for an Orphan Process ? shatmanyu Linux - Newbie 5 10-18-2010 05:04 PM
How can I create an orphan process and see it's stat joyrock Programming 5 01-01-2010 03:01 PM
Zombie Process N|k0N Linux - Security 8 09-22-2007 02:01 AM
orphan child process happy78 Programming 3 08-30-2005 01:40 AM
zombie process ihatecomputers Linux - Software 2 03-24-2005 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration