Re: how to kill a subprocess

2010-09-10 Thread Christian Heimes
Am 10.09.2010 22:14, schrieb cerr: > No, the Perl becomes the zombie. How are you killing the Python process? Are you sending SIGINT, SIGTERM or SIGKILL? SIGKILL can prevent Python from running its cleanup code. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: how to kill a subprocess

2010-09-10 Thread cerr
On Sep 10, 12:18 pm, Christian Heimes wrote: > Am 10.09.2010 20:56, schrieb cerr: > > > But I wanna kill the child process I start from my python code. > > It's like > > PHP -> Python -> Perl > > > and when the connection PHP -> Python seems to work well! > > You have said that the Python process

Re: how to kill a subprocess

2010-09-10 Thread Christian Heimes
Am 10.09.2010 20:56, schrieb cerr: > But I wanna kill the child process I start from my python code. > It's like > PHP -> Python -> Perl > > and when the connection PHP -> Python seems to work well! You have said that the Python process becomes a zombie process. This clearly tells me that the iss

Re: how to kill a subprocess

2010-09-10 Thread cerr
On Sep 10, 11:45 am, Christian Heimes wrote: > Am 10.09.2010 19:51, schrieb cerr: > > > Thanks for your suggestion, changed my code now to: > > >   process=subprocess.Popen(commandlist) > >   ... > >   ... > >   process.kill() > >   os.waitpid(process.pid, 0) > > but it's not killing the process r

Re: how to kill a subprocess

2010-09-10 Thread Christian Heimes
Am 10.09.2010 19:51, schrieb cerr: > Thanks for your suggestion, changed my code now to: > > process=subprocess.Popen(commandlist) > ... > ... > process.kill() > os.waitpid(process.pid, 0) > but it's not killing the process running. it still runs in the > background and i don't see any e

Re: how to kill a subprocess

2010-09-10 Thread cerr
On Sep 9, 4:18 pm, MRAB wrote: > On 09/09/2010 23:52, cerr wrote: > > > > > On Sep 9, 3:29 pm, Alain Ketterlin > > wrote: > >> cerr  writes: > >>> I'm calling a python script from a php script which again calls a perl > >>> script with subprocess.popen(). > >>> This seems to work fine so far only

Re: how to kill a subprocess

2010-09-09 Thread Alain Ketterlin
cerr writes: >> x.terminate() (and then x.wait()) where x is the value returned by >> subprocess.Popen(). > Well, this is what I have: > > writelog("starting GPS simulator") > commandlist=[GPSsim,proto,GPSfile] > writelog(commandlist[0]+" "+commandlist[1]+" "+commandlist[2]) > process=sub

Re: how to kill a subprocess

2010-09-09 Thread MRAB
On 09/09/2010 23:52, cerr wrote: On Sep 9, 3:29 pm, Alain Ketterlin wrote: cerr writes: I'm calling a python script from a php script which again calls a perl script with subprocess.popen(). This seems to work fine so far only that once the python script completed it is becoming a zombie becau

Re: how to kill a subprocess

2010-09-09 Thread cerr
On Sep 9, 3:29 pm, Alain Ketterlin wrote: > cerr writes: > > I'm calling a python script from a php script which again calls a perl > > script with subprocess.popen(). > > This seems to work fine so far only that once the python script > > completed it is becoming a zombie because the perl script

Re: how to kill a subprocess

2010-09-09 Thread Alain Ketterlin
cerr writes: > I'm calling a python script from a php script which again calls a perl > script with subprocess.popen(). > This seems to work fine so far only that once the python script > completed it is becoming a zombie because the perl script in the > background is still running... so before i