Subject: Re: rc.d and rcorder
To: Matthias Scheler <>
From: Malcolm Herbert <>
List: netbsd-users
Date: 04/23/2007 22:55:04
On Mon, Apr 23, 2007 at 12:58:13PM +0100, Matthias Scheler wrote:
|On Mon, Apr 23, 2007 at 11:14:35AM +1000, Malcolm Herbert wrote:
|> Having recently been exposed to the Sun Solaris smf subsystem, are there
|> any thoughts on extending NetBSD's rc system to provide monitoring of
|> the started services? ie, who/what is responsible for monitoring the
|> health of a particular service provided by the rc.d script?
|There is no such service at the moment. For services without dependences
|a "cronjob" like this will do:
|* * * * *	(/etc/rc.d/foo status || /etc/rc.d/foo start) >/dev/null 2>&1
|Not pretty but it works.

Was thinking similar, actually, but somehow using rcorder and keywords as
well, say

* * * * * ( \
  for rc in `rcorder -k restart /etc/rc.d/*` ; do \
    $rc status || $rc * start ; \
  done \
) > /dev/null 2>&1

rcorder here used to weed out everything except those with the appropriate
keyword rather than for ordering ...

how one goes from that to having a foo restart dependancy on bar, I'm
not sure ...

Also, the smf stuff would allow you to say that network shares aren't
mounted if the network doesn't come up, that sort of thing - it doesn't
just provide an order to start things, is really my point I guess.

|> Apart from the fact that the configuration files to manage it are way
|> over-engineered, it looks pretty good ...
|There is another (or used to be another?) problem. Solaris tries to
|start up things in parallel but doesn't have all the dependences
|properly defined. So depending on the speed of your machine, disks
|and eventually the network various things might not work properly
|if your system comes up.

hmmm ... hadn't heard of that one ... thought things would just stall
if something took longer than usual to start ... 

More than a little off-topic now, but I also ran into a kink today
where if you boot a solaris box with 'boot -m debug' from the PROM
you may find a whole swathe of things that don't start since svc.startd
is spending too much time telling you about stuff (at 9600bd) and
things time out ... 

Malcolm Herbert                                This brain intentionally                                                left blank