Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: How to verify if a daemon is up and running ?by rob_au (Abbot) |
on Dec 03, 2002 at 20:53 UTC ( [id://217343]=note: print w/replies, xml ) | Need Help?? |
I would recommend the usage of Proc::ProcessTable which I have reviewed previously on this site here. Using Proc::ProcessTable, your code would look something like this:
This code will count the number of testd processes running on the system, returned in $running, which should allow you to determine whether this existing process should continue execution. The other approach to this problem would be to incorporate a process identification or lock file, as suggested by Ryszard above, which can be monitored external the current execution process.
perl -le 'print+unpack("N",pack("B32","00000000000000000000000111110001"))'
In Section
Seekers of Perl Wisdom
|
|