Managing a Sub-Process

Greg Lindstrom gslindstrom at
Sun Sep 6 15:06:03 CEST 2009

I am using Python 2.6 on Gentoo Linux and have a routine that gets/puts
files to other servers via sftp.  We have an ongoing problem with various
sftp processes "hanging"; that is, it no longer transfers any data but does
not shutdown/timeout.  I would like to design a routine that will kick off
the sftp (or whatever) module and then monitor it.  If the sub-process hangs
(or fails any other criteria we define) it could be killed in the main
routine and an error could be logged.

How can I do this?  I've looked into the subprocess module as well as the
Twisted package but I thought that before I launch onto building my own
system to accomplish this I'd ask if it's been done before and, if so, how?
What are the isues I need to worry about?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list