[PLUG] Re: Check program running...

Randal L. Schwartz merlyn at stonehenge.com
Wed Jan 24 05:39:28 UTC 2007


>>>>> "plug" == plug 0 <plug_0 at robinson-west.com> writes:

plug> One thought is to have setdodoip.pl create a file when it
plug> starts.  Trouble is, that file could still exist when
plug> setdodoip.pl isn't running.  In the perl script, can I
plug> add deleting the file I create when the process is
plug> killed or doesn't start?

Just have it flock a file exclusively.  Then try to get that flock, because
if you can, the program is gone.

See examples of Perl flock at my "highlander" solution ("there can be only
one!") at <http://www.stonehenge.com/merlyn/WebTechniques/col54.html>.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!




More information about the PLUG mailing list