Re: python at login on macintels



In article
<tomstiller-A14131.23111403062006@xxxxxxxxxxxxxxxxxxxxxxxx>,
Tom Stiller <tomstiller@xxxxxxxxxxx> wrote:

In article <nospam.News.Bob-E7F013.19131603062006@xxxxxxxxxxxxxxxx>,
Bob Harris <nospam.News.Bob@xxxxxxxxxxxxxxxxxxxxxx> wrote:

Zombies: Your answer is close, but off by just a tiny bit.

A Zombie is a process that has terminated and is waiting for its
_STILL_ _ALIVE_ parent to reap the completion status.

If the parent process goes away and abandons the child before or
after the child process terminates the child process is inherited
by the 'init' process (process PID 1), and the 'init' process will
reap the status of the zombie process.

So the zombie hangs around until shutdown.

Zombie hang around until its parent process either issues a system
call from the wait() family, or the parent process terminates
which allows the zombie to be inherited by 'init', and init will
issue a wait to collect the completion status.

If the parent does not issue the wait, and the parent runs until
shutdown, then yes, the zombie will stay around until shutdown.
It still goes away the same way. During shutdown the parent will
be killed, the zombie is inherited by 'init', and its completion
status reaped.


So this means that the parent process actually still exists, or it
would not be a zombie.

You can find the parent process using the ps command

ps -o ppid,command -p [pid-of-the-zombie-process]

Then repeat using the PPID

ps -o command -p [PPID-from-previous-ps]

Interesting, but I'm not sure the explanation fits the case here.
Before logout there was a process, sctwistd, running with, say, pid 123.
After logout and re-login pid 123 is a python zombie.

Based on what you say, then sctwistd was killed as part of logout,
but its parent process was not, and the parent process did not
issue a wait to reap the completion status.

ps -o ppid,command -p 123
PPID COMMAND
nnnn (python)

ps -p [nnnn]

What is this parent process? That is the offender.

This is how zombies have worked since I first started using UNIX
back in 1985. This is how zombies worked when I was a Digital
Tru64 UNIX kernel developer. And as far as I know, this is how
zombies work on MacOSX and Linux. The zombie waits for its
parent, and if it parent dies, it is automatically adapted by
'init' which gives it the needed care and attention.

Bob Harris
.



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: python at login on macintels
    ... A Zombie is a process that has terminated and is waiting for its ... after the child process terminates the child process is inherited ... Zombie hang around until its parent process either issues a system ... 5061 p1 R+ 0:00.00 grep python ...
    (comp.sys.mac.system)
  • Re: kill zombies
    ... >>zombie's parent process to reap the zombie's termination status. ... A zombie is, by definition, a terminated process that hasn't had it's ... the process's parent is dead, and init hasn't yet reaped the zombie process's ...
    (alt.os.linux.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)