in reply to use flock() to determine if other script is running

Can't you use your lock file to store this information? Of course you will need to keep track of every birth and death. Another possible approach is to drop a file every time you start a process in a predefined directory and count them to know how many processes are running. This kind of counter can use the timestamp of files to know if a process aborted (you need to simulate an heartbeat, updating mtime of your files periodically).
There is also Only let one copy of program run at a time, published today by esh, and Parallel::ForkManager.

Ciao, Valerio

  • Comment on Re: use flock() to determine if other script is running