On 10/22/2014 03:33 AM, Dejan Muhamedagic wrote:
> Hi Alan,
>
> On Mon, Oct 20, 2014 at 02:52:13PM -0600, Alan Robertson wrote:
>> For the Assimilation code I use the full pathname of the binary from
>> /proc to tell if it's "one of mine".  That's not perfect if you're using
>> an interpreted language.  It works quite well for compiled languages.
> Yes, though not perfect, that may be good enough. I supposed that
> the probability that the very same program gets the same recycled
> pid is rather low. (Or is it?)
>From my 'C' code I could touch the lock file to match the timestamp of
the /proc/pid/stat (or /proc/pid/exe) symlink -- and verify that they
match.  If there is no /proc/pid/stat, then you won't get that extra
safeguard.  But as you suggest, it decreases the probability by orders
of magnitude even without the

The /proc/pid/exe symlink appears to have the same timestamp as
/proc/pid/stat

Does anyone know which OSes have either or both of those /proc names?

    -- AlanRobertson
       al...@unix.sh


_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to