Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2006 09:40:26 -0700 (PDT)
From:      "Jeremy C. Reed" <reed@reedmedia.net>
To:        Alan Robertson <alanr@unix.sh>
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:  <Pine.NEB.4.62.0606080839500.4410@pilchuck.reedmedia.net>
In-Reply-To: <447D955F.4070907@unix.sh>
References:  <20060513015129.C95601@arbitor.digitalfreaks.org> <446D3B73.3040202@unix.sh> <447D87DC.7040104@coolfactor.org> <447D955F.4070907@unix.sh>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 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?

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.

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

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.



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