469,270 Members | 1,731 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Ack! Zombie processes won't die!

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?
Jul 18 '05 #1
1 1844
Brian wrote:
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.
--
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
Keith Dart <kd***@kdart.com>
public key: ID: F3D288E4
================================================== ===================
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Pav Lucistnik | last post: by
4 posts views Thread by Michael--J | last post: by
4 posts views Thread by Rachel Devons | last post: by
1 post views Thread by cfyam | last post: by
13 posts views Thread by Rob | last post: by
6 posts views Thread by Bjoern Schliessmann | last post: by
7 posts views Thread by kandola47 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.