Given PID, make sure a process is running on Unix?

VanL news at lindbergs.org
Sat Jul 6 17:31:57 EDT 2002


Hello,

I am trying to get write a python script that  on Unix reads 
a PID from a file and, if that process is still running, 
exits.  If the process is not running, the process would be 
started.

I have everything written except the part that makes sure 
the process is running.  I have poked through the os module, 
but I can only seem to find information about the current 
process or child processes, not just some arbitrary process.

This would run from cron or as a daemon, sleeping most of 
the time.

Any help?

Thanks,

VanL






More information about the Python-list mailing list