Detecting and interacting with long running process

Posted by jacquesb on Stack Overflow See other posts from Stack Overflow or by jacquesb
Published on 2010-06-13T13:29:14Z Indexed on 2010/06/13 13:32 UTC
Read the original article Hit count: 161

Filed under:

I want a script to start and interact with a long running process. The process is started first time the script is executed, after that the script can be executed repeatedly, but will detect that the process is already running. The script should be able to interact with the process. I would like this to work on Unix and Windows.

I am unsure how I do this. Specifically how do I detect if the process is already running and open a pipe to it? Should I use sockets (e.g. registering the server process on a known port and then check if it responds) or should I use "named pipes"? Or is there some easier way?

© Stack Overflow or respective owner

Related posts about python