Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Jun 2006 12:45:25 -0600
From:      Alan Robertson <alanr@unix.sh>
To:        "Jeremy C. Reed" <reed@reedmedia.net>
Cc:        freebsd-rc@freebsd.org, ocf@lists.community.tummy.com, tech-userlevel@netbsd.org, General Linux-HA mailing list <linux-ha@lists.linux-ha.org>, Gavan Fantom <gavan@coolfactor.org>
Subject:   Re: [Linux-HA] Integrating OCF framework w/ (Net|Free)BSD rc.d
Message-ID:  <44887045.8030504@unix.sh>
In-Reply-To: <Pine.NEB.4.62.0606080839500.4410@pilchuck.reedmedia.net>
References:  <20060513015129.C95601@arbitor.digitalfreaks.org> <446D3B73.3040202@unix.sh> <447D87DC.7040104@coolfactor.org> <447D955F.4070907@unix.sh> <Pine.NEB.4.62.0606080839500.4410@pilchuck.reedmedia.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Jeremy C. Reed wrote:
>>>> 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).
> 
> I didn't see anything else posted about this on the FreeBSD 
> freebsd-rc or NetBSD tech-userlevel lists ...
> 
> Our rc.d system does have a monitor. Will this work:
> 
>   $ sudo /etc/rc.d/cron poll
>   Waiting for PIDS: 21395, 21395, 21395, 21395
> 
> and continues forever (checking every two seconds) until PIDs do not 
> exist.
> 
> Is this the type of monitoring you are mentioning?

This sounds like a "status" over and over again.  We can already repeat 
status over and over again.  And, we wouldn't know what to do with a 
script which did what this one does.

As an example of how we distinguish status from monitor for our apache 
resource agent.  Status returns success if the process is running, and 
monitor returns success if it can retrieve a web page from the web 
server.  So, monitor is a more thorough test.

But, having _some_ kind of status is better than no status at all ;-)

> The rc.d "status" does return a status code.
> 
> If not running, then it returns a 0 (zero). If it is running, it returns a 
> 1 (one). It also says "... is not running" or "... is running as pid 
> .....".
> 
> There is no metadata you can retrieve from the scripts.

Too bad.  It's always nice to be able to tell someone what this script 
does ;-)

> By the way, they are not call BSD init scripts. Some BSD operating systems 
> do not use them.

OK.

> They originated in NetBSD a few years ago. FreeBSD's are based on these, 
> but have been slowly diverging. (On a side note, we need to go through the 
> changes and improvements between NetBSD's , FreeBSD's, and DragonFly's 
> rc.subr to see if we can keep this code closer in sync. I am not 
> suggesting the rc.d scripts should be same though.)
> 
>  Jeremy C. Reed
> 
> p.s. I also use NetBSD's rc.subr/rc.d system on various Linux boxes.



-- 
     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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44887045.8030504>