Linux - NewbieThis 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
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.)
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.