Hi,
Search on search.cpan.org for File::PID and download and install that
module.
It might help you to create PID files.
To clarify the need for using a PID file, I think it needs to be used for
example when somebody wants to run a program manually or from a chron job
but when the admin doesn't want to run the program twice, so he should
verify if that program is running.
The program runs, opens the PID file, gets the PID from there and verifies
if there is a program with that PID which is running in that moment.
The program can't verify in another way if it is running, because the same
program may be ran with different command lines or links to it.
Am I wrong?
Octavian
----- Original Message -----
From: "Michael Barnes" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Sunday, April 27, 2008 4:30 AM
Subject: Creating PID file
This may be a bit advanced for a beginner's group, but I need to have my
script create a pidfile. I'm running a monitor app that keeps track of
what is running and notifies me when stuff stops. It does it by
comparing the pid in the pidfile with ps. So, I need my script to
create a pidfile when it starts.
Ideas appreciated.
Thanks,
Michael
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/