On Mon, Oct 20, 2014 at 03:04:31PM -0600, Alan Robertson wrote:
> On 10/20/2014 02:52 PM, 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.

It works just as well (or as bad) from interpreted languages:
readlink /proc/$pid/exe
(very old linux has a fsid:inode encoding there, but I digress)

But that does solve a different subset of problems,
has race conditions in itself, and breaks if you have updated the binary
since start of that service (which does happen).

It does not fully address what I am talking about.

> I somehow missed that you were talking about resource agents.

Not exclusively.
But any solution should easily work for any caller and an easily
unserstood set of conventions, regarless of implementation language.

> But shouldn't the CRM guarantee that no more than one is running anyway
> - making some conditions a lot less likely?

You miss the point.

Point being:
        kill -TERM $pid
        while kill -0 $pid ; do sleep 1; done
may "never" terminate.

> If you care, the source for the code I mentioned is here:
> http://hg.linux-ha.org/assimilation/file/tip/clientlib/misc.c

        Lars

_______________________________________________________
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