Subject: Re: [Linux-HA] Integrating OCF framework w/ (Net|Free)BSD rc.d
To: Gavan Fantom <gavan@coolfactor.org>
From: Alan Robertson <alanr@unix.sh>
List: tech-userlevel
Date: 05/31/2006 07:08:47
Gavan Fantom wrote:
> Alan Robertson wrote:
>> Brian A. Seklecki wrote:
>>> What is OCF? The extensions required to make any RC script register a
>>> system service as a Cluster Resource in the Linux-HA infrastructure.
>>>
>>> For those of you unfamiliar with OCF, please refer to the draft
>>> standard at:
>>> http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/resource-agent-api.txt?rev=HEAD
>>>
>>> http://linux-ha.org/HeartbeatResourceAgent
>>> http://linux-ha.org/LSBResourceAgent
>>> http://linux-ha.org/OCFResourceAgent
>>> http://linux-ha.org/ResourceAgentSpecs
>>>
>>> Fortunately, our rc.d system infrastructure is sufficiently extensible
>>> in nature to easily mitigate the need for duplicate OCF script coding
>>> efforts by Port maintainers. Existing in-tree and Ports-provided
>>> rc.d/ compliant scripts can be extended with very little effort.
>> OK. You don't have to write OCF scripts if you don't want to. BUT, for
>> R2, you really do want something equivalent to "status" operations. Is
>> that available in *BSD rc.d scripts?
>
> /etc/rc.d/<script> status
>
> Does that do what you want?
Well...
OCF resource agents also have a (hopefully) more thorough test called
"monitor". That's a value add over "status" (at least to some degree),
as are a number of other things it does...
But speaking from a minimum requirements basis:
If status returns a reliable return code it probably meets the minimal
needs. Minimally there needs to be at least two distinct classes of
return codes: one for running and one for not running. Optimally,
there ought to be at least three: Running, stopped, and
something's-wrong-here.
Is there some kind of metadata (description, etc) that one can
mechanically get out of the scripts? In LSB init scripts, there is a
certain style of comment which makes it possible for us to give some
help to the user in configuring these resources.
If such information can be obtained from BSD init scripts, then so much
the better. (It's not strictly necessary, but it is nice).
If you want to see how we "fake up" these kinds of things for the LSB
init scripts, then see lib/plugins/raexeclsb.c. One could easily
imagine a lib/plugins/raexecfreebsd.c that did what you needed.
See also:
http://cvs.linux-ha.org/viewcvs/viewcvs.cgi/*checkout*/linux-ha/lib/plugins/lrm/raexeclsb.c?content-type=text%2Fplain
We're not going to write raexecfreebsd.c, but we'd certainly entertain a
patch providing it ;-).
[On the other hand, if you seriously wanted to switch to OCF style
scripts, that would be absolutely awesome, and we'd love to discuss it.
I'm sure that would be a difficult thing to sell folks on, but it has
its advantages too].
--
Alan Robertson <alanr@unix.sh>
"Openness is the foundation and preservative of friendship... Let me
claim from you at all times your undisguised opinions." - William
Wilberforce