LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   a dumb question but i'm a noobie with linux (https://www.linuxquestions.org/questions/linux-newbie-8/a-dumb-question-but-im-a-noobie-with-linux-597621/)

mrryanthai 11-06-2007 05:52 PM

a dumb question but i'm a noobie with linux
 
what is a zombie?thanks

jlgreer1 11-06-2007 05:54 PM

A process that has died but has not yet relinquished its process table slot (because the parent process hasn't executed a wait(2) for it yet). These can be seen in ps(1) listings occasionally.

sundialsvcs 11-06-2007 08:03 PM

Welcome aboard! Remember, there is no "dumb question" other than the one you are too timid to ask. :) Every single one of us started where you are now, and we remember it well.

One of the key ideas in Unix/Linux is that you can launch another program to do some useful part of whatever-it-is that you happen to be doing. (Which happens to be a very useful idea.) But the problem is, if we now have all these programs executing independently of one another, yet nonetheless needing to find out whether some-other program (that they had launched...) succeeded or failed, we need to have a way for the programs to rendezvous with one another. In other words, if "program-A" launches "program-B" and then needs to do one-thing versus another-thing based on whether "program-B" succeeded or failed ... then we need to have a reliable way for "program-A" to determine the outcome of "program-B" ... no matter which one of the two programs happens to "finish first."
  1. If "program-B" is a slowpoke, then "program-A" will just wait.
  2. But what if "program-B" is a speed-demon? What if "program-B" comes-and-goes before "program-A" gets a chance to find out what it did?
So here's what happens: when "program-B" finishes, instead of going-away completely, it becomes a "zombie." It's waiting for "program-A" (its "parent") to investigate it. Only when its parent ("program-A") actually does so will "program-B" completely disappear.

(Yes, it is waiting-around in zombie-land specifically so that its parent has an opportunity to find out what happened, no matter which one may have finished first. This is "why" the notion of 'zombies' exists...)

And in case you are wondering, "what if 'program-A' dies, and never inquires about 'program-B'?" Well, in that case, Linux itself (technically: "the init process") plays The Grim Reaper and cleans-up the mess...

zebias 11-07-2007 12:53 AM

Zombies are dead processes. You cannot kill the dead. All processes eventually die, and when they do they become zombies. They consume almost no resources, which is to be expected because they are dead! The reason for zombies is so the zombie's parent (process) can retrieve the zombie's exit status and resource usage statistics. The parent signals the operating system that it no longer needs the zombie by using one of the wait() system calls.


If you have zombie processes it means those zombies have not been waited for by their parent (look at PPID displayed by ps -l)




Zebias Zingoni

zebias 11-07-2007 01:08 AM

A zombie is a process that has completed execution but still has an entry in the processes table allowing the process that started it to read its exit status

You can use a # top or #ps
to find a zombie process.


All times are GMT -5. The time now is 08:57 AM.