Want to monitor process..

Joshua Muskovitz joshm at taconic.net
Thu Feb 28 21:32:12 EST 2002


> I'm chuckling to myself. This is exactly what I'm doing at the moment
> too and it sucks. I'm so glad you asked this question, Haeyoung, and
> described it so well :)

I described a solution about six weeks ago (with code!).  Here's the link
(or search on google yourself for SingleInstance and Muskovitz):

http://groups.google.com/groups?q=SingleInstance+Muskovitz+group:comp.lang.p
ython

Basically, your app creates a lockfile, and periodically touches it.  An
external app can check the timestamp on the file, and if it is too old, then
your process has hung up and could be killed/restarted.  Alternately, you
can stick your app directly in cron.  When a new instance starts up, it can
check the lock and if things are ok, then it can just kill itself.

The code works on NT and Solaris.  I haven't tried other platforms.
--
# Joshua Muskovitz
# joshm at taconic.net
def lyyrs(sig): return '-'.join(sig.split()+["ly y'rs"])
lyyrs('Hire me!  I need the work!')




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list