Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Preventing multiple instancesby jeffenstein (Hermit) |
on Dec 18, 2020 at 10:21 UTC ( [id://11125400]=note: print w/replies, xml ) | Need Help?? |
Assuming that the process is not running as root, you can kill -0 $(cat /path/to/file.pid) to see if the current user owns that process, or if it's running at all. Of course, lock the file before checking, and write the correct pid with the same lock. There is Proc::Daemon which can take a pid file, but I haven't used it, so I don't know if it does the right thing.
In Section
Seekers of Perl Wisdom
|
|