Perl: the Markov chain saw | |
PerlMonks |
Re: Detecting stale pid file under *nixby andal (Hermit) |
on Oct 25, 2016 at 07:20 UTC ( [id://1174648]=note: print w/replies, xml ) | Need Help?? |
If you are already checking the /proc/$pid, then why don't you check /proc/$pid/cmdline to see, if it contains name of your daemon? Or you can read destination of the symbolic link /proc/$pid/exe to see if it points to the executable of the daemon If the daemon is your own application, then you may want to change it so that it listens for termination (or other commands) on some hidden unix socket. Then you can terminate it by writing to that socket.
In Section
Seekers of Perl Wisdom
|
|