Ack! Zombie processes won't die!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian

    #1

    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?
  • Keith Dart

    #2
    Re: Ack! Zombie processes won't die!

    Brian wrote:[color=blue]
    > 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?[/color]

    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 <kdart@kdart.co m>
    public key: ID: F3D288E4
    =============== =============== =============== =============== =========

    Comment

    Working...