On Apr 24, 6:13 pm, Philip Jenvey <[email protected]> wrote: > 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? >
Exactly > 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? > If I run the same command from the command line, and issue a CTRL-c, then it does kill it. The command is: C:\jython2.5.1\jython.bat C:\jython2.5.1\bin\paster serve development.ini I'm wondering if it could be a problem because it's a batch file? > 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. > Unfortunately, this doesn't seem to do it either. :( > -- > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/pylons-discuss?hl=en. Thanks, and if anyone has any more ideas, I'm happy to hear them. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
