I have another idea!
What is about lsof?
we should check the pid is running and the process is running having the
pidfile opened!
we will lose one open filehandle for every daemon ... i
think this is not so bad, but we will get a system without a possible
failure! (i hate name matching in processtable :-/ )
why you use a open & flock and not a sysopen with O_CREAT|O_EXCL? i
think this would be a better solution. But perhaps i miss a point.
only problem is, pidfile exists, pidfile is empty, two processes are
running ... but the last one will clean the situation :)
one more suggestion: shell-init-scripts. This should also work, but will
require additional checks. But with App::Daemon, did we need another
shell-init-script?
On Di. 24. Mär. 2009, 05:08:41, Sadrak wrote:
Show quoted text> Is it not a good plan to check the name of the app? There is already
> that check, but only for the status, but i think this would be great to
> check that for a kill or a start to check the last possible failure:
>
> the pidfile exists and the process with this pid is not the daemon!
>
> the process wont start and a stop will kill the wrong process!
>
> perhaps a var to enable that?
>
> $App::Daemon::check_name = 1;
>
> Perhaps i dont see another problem with that, when you say: that would
> be a good idea, i will make a patch and append it :)