On Apr 22, 2010, at 12:36 AM, Alec Munro wrote:

> Hi List,
> 
> I have a Java class that I need to access from Python, and my solution
> for the time being is to wrap it in a Jython web service, using
> Pylons. I'm using subprocess.Popen to start this server, but I need a
> good way to stop it. Using any of the kill functionality from
> subprocess or the win32 modules always leaves me with dangling
> processes. I'm hoping that I can simply expose a web service call that
> will shutdown Pylons. However, short of sys.exit(), I haven't been
> able to find anything, and I'm not even sure if that will work.

Do you mean you're running a Pylons web service in Jython, and having another 
Python process start it up via subprocess?

If so I'm not sure why sending the subprocess a kill/terminate signal would 
cause it to dangle, it could depend on what the parent process is doing. You 
may need to pass close_fds=True to Popen. Can you kill it normally when it's 
ran outside of your other process?

A web service call to shutdown Pylons via sys.exit could work, but I'd want to 
know why the process was dangling when killed. It may even zombie after calling 
sys.exit() on itself due to the same issue.

--
Philip Jenvey

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-disc...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to