Re: python at login on macintels



In article <nospam.News.Bob-854FA0.15321104062006@xxxxxxxxxxxxxxxx>,
Bob Harris <nospam.News.Bob@xxxxxxxxxxxxxxxxxxxxxx> wrote:

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.

You are correct, but then, you knew that ;-) Here's what happens:

tms@imac% ps ax | grep sctwistd
4857 ?? Ss 0:04.29
/System/Library/PrivateFrameworks/DedicatedNetworkBuilds.framework/
Resources/sctwistd

Logout/Login

tms@imac% ps ax | grep python
4857 ?? Z 0:00.00 (python)
5061 p1 R+ 0:00.00 grep python
tms@imac% ps -o ppid,command -p 4857
PPID COMMAND
4833 (python)
tms@imac% ps -o ppid,command -p 4833
PPID COMMAND
1
/System/Library/PrivateFrameworks/DedicatedNetworkBuilds.framework/Resour
ces/bfobserver

Unloading bfobserver cleans up all the mess.
Thanks for explaining the mechanism.

--
Tom Stiller

PGP fingerprint = 5108 DDB2 9761 EDE5 E7E3
7BDA 71ED 6496 99C0 C7CF
.



Relevant Pages

  • 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 ... which allows the zombie to be inherited by 'init', ...
    (comp.sys.mac.system)
  • 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: Why doesnt kill work?
    ... >> with out sending the exit code to the child process. ... Killing the parent process will always get rid of any ... This status information, which primarily includes an exit code, ... > remembering those few status bytes, the zombie process entry stays ...
    (Fedora)
  • 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 ... So this means that the parent process actually still exists, ...
    (comp.sys.mac.system)