Re: Why doesn't kill work?

From: Scot L. Harris (webid_at_cfl.rr.com)
Date: 02/21/05

  • Next message: Jim Cornette: "Re: fc3 ftp connects but not working (Solved)"
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    Date: Sun, 20 Feb 2005 23:46:56 -0500
    
    

    On Sun, 2005-02-20 at 23:29, Deron Meranda wrote:
    > On Sun, 20 Feb 2005 23:00:15 -0500, Scot L. Harris <webid@cfl.rr.com> wrote:
    > > Such [zombie] processes usually result from the parent being killed or exiting
    > > with out sending the exit code to the child process.
    > >
    > > As far as know these will hang around until you reboot the system.
    > > Would be good to try to identify the program that is generating the
    > > zombies and see if there is a fix. It really should clean up after
    > > itself.
    >
    > You've got the direction (parent->child) reversed.
    >
    > A zombie is always the result of it's parent process, never it's
    > own fault. Killing the parent process will always get rid of any
    > zombies; you don't need to reboot unless the parent itself can't
    > be killed.
    >
    > What really happens is when a process dies (for whatever reason),
    > there is a small amount of status information that is saved so the
    > parent process later can tell why it's child died and if it was "successful"
    > or not. This status information, which primarily includes an exit code,
    > is usually just a few bytes in size. But the kernel saves it until the
    > parent process gets around to asking for it (which when it does so
    > is called "reaping" the child process). As long as the kernel is
    > remembering those few status bytes, the zombie process entry stays
    > in the process listing. Of course there is no real process (it has
    > since died and all it's memory/resources released back to the OS).
    > A zombie will stay as long as the parent process ignores it and fails
    > to ask for its exit status code, or until the parent itself dies, whichever
    > occurs first.
    >
    > Whenever almost any process dies, zombies are created. But most
    > parent processes (like bash for example) immediately reap the zombie,
    > so you'll almost never see them. However, some parent processes are
    > not designed properly to react to dead children in a timely manner, so
    > you may see zombie processes. Again, it's the parent process to blame.
    >
    > --
    > Deron Meranda

    So if the parent process crashes all of the child processes will be
    cleared? I thought the parent process had to issue an _exit() (or
    something similar) to get the child process status so it would exit
    cleanly. If it did not do that then the child process sits around
    waiting for the parent which is no longer running so it stays forever.

    I could still have that wrong. Been awhile since I did that kind of
    coding.

    -- 
    Scot L. Harris
    webid@cfl.rr.com
    Why be difficult when, with a bit of effort, you could be impossible? 
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Jim Cornette: "Re: fc3 ftp connects but not working (Solved)"

    Relevant Pages

    • Re: [opensuse] openSUSE 10.2 - process mono defunct
      ... it so confused that can't die cleanly and turns zombie. ... and whose parent process is still running but has not issued a wait ... system call to retrieve its child's exit status. ... Init _always_ reaps its children or descendants. ...
      (SuSE)
    • Re: Difference Between Orphans and Zombies
      ... The definition of an orphan and a zombie process is well known, ... - - The parent process is expected to monitor the health of any children ... then the children processes become 'orphans', ... - - If the child process terminates before the parent process does, ...
      (comp.unix.admin)
    • Re: Why doesnt kill work?
      ... > with out sending the exit code to the child process. ... A zombie is always the result of it's parent process, ... This status information, which primarily includes an exit code, ...
      (Fedora)
    • Re: A tricky problem about Process.wait and popen
      ... signal of child process exit sent to parent process will lost. ... It's not a bug. ...
      (comp.lang.ruby)
    • Re: A tricky problem about Process.wait and popen
      ... signal of child process exit sent to parent process will lost. ... It's not a bug. ...
      (comp.lang.ruby)