Ack! Zombie processes won't die!

B

Brian

From one script, I'm spawnv'ing another that will launch mpg123 to play a
specified mp3. Problem is that After the second script has launched
mpg123, it'll turn into a zombie process. It doesn't happen when I launch
it from the command line, so there's something wrong with the way I'm
calling it (I believe).

mp3pid = os.spawnv(os.P_NOWAIT, "/oter/playfile.py", ["playfile", filename,
"0"])

Shouldn't this launch the script without waiting for it to finish?
 
K

Keith Dart

Brian said:
From one script, I'm spawnv'ing another that will launch mpg123 to play a
specified mp3. Problem is that After the second script has launched
mpg123, it'll turn into a zombie process. It doesn't happen when I launch
it from the command line, so there's something wrong with the way I'm
calling it (I believe).

mp3pid = os.spawnv(os.P_NOWAIT, "/oter/playfile.py", ["playfile", filename,
"0"])

Shouldn't this launch the script without waiting for it to finish?

It does, but the OS keeps the process information around until you
"wait" on it, with "reaps", or collects the exit status then. You can do
this asyncronously with a SIGCHLD handler. However, this has already
been done.

In the the pyNMS package on sourceforge
(http://sourceforge.net/projects/pynms) there is a module called
"proctools". It has a process manager that does this for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top