[Chicago-talk] pid files and whatchamacalits.

Dooley, Michael Dooley.Michael at con-way.com
Tue Dec 9 16:50:23 CST 2003


I have a perl script that runs via cron.

outside of checking for a pid file does anyone have any cleaner ways of
checking to see if the script is already running?

I was looking at Proc::PID_File. but I would like to try and stay with the
default install of perl.
This is perl, v5.8.0 built for sun4-solaris

Is below a standard way to do this?

if (-e "/tmp/pid.file") {
exit;
} else {
open (PID, ">/tmp/pid.file");
print PID $$;
close PID;
}



More information about the Chicago-talk mailing list