By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,253 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,253 IT Pros & Developers. It's quick & easy.

Ack! Zombie processes won't die!

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.