On 5/24/07, Brian Reichert <[EMAIL PROTECTED]> wrote:
On Thu, May 24, 2007 at 06:05:27PM +0200, Andrew Beekhof wrote:
> >I don't see what the checks in /proc gets you at this point; how
> >is that different than
> >
> > ( kill(pid,0) != -1 ) && pid !=getpid() )
> >
> >I'm not used to using /proc for this stuff
>
> it tells you if the pid has been reused by another, unrelated, process.
> its just an extra check available to linux users.
Doesn't the expression I cite above also test for reused and unrelated
(where 'unrelated' means 'not me')?
no.
pid !=getpid() will always fail - even when another heartbeat process
_is_ running.
unrelated != not me
"unrelated" means "not another heartbeat process".
In that, we're running as root,
we'll never see EINVAL or EPERM, and ESRCH is the only other document
failure.
I suppose this could be tighted by expressly testing for ESRCH, and
that set of logic is already accomplished by cl_read_pidfile()...
--
Brian Reichert <[EMAIL PROTECTED]>
55 Crystal Ave. #286 Daytime number: (603) 434-6842
Derry NH 03038-1725 USA BSD admin/developer at large
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems