Subject: Re: /etc/rc. use bsd.rc.mk instead.
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: tech-userlevel
Date: 12/04/1999 03:06:35
[ On Friday, December 3, 1999 at 23:11:06 (-0800), Greywolf wrote: ]
> Subject: Re: /etc/rc. use bsd.rc.mk instead.
>
> On Fri, 3 Dec 1999, Greg A. Woods wrote:
> 
> # I seem to recall mentioning then that "make" might not be the ideal
> # dependency maintenance tool for this job.  I personally do like the
> # concept of a more restricted finite state machine a little bit better.
> 
> So why not figure out the smallest possible subset of stuff that such
> a mini-make would need and either #ifdef SMALL it out of make or
> create a 'mk' command which would DTRT.

I don't think that's the problem -- it's more like that any form of
"make"-style tool is unsuitable.

I like the example syntax Fred posted though....

If indeed a finite state machine is the right model then there are
probably other better notations for representing the states and the
necessary transition paths too.

The really good thing about run levels controlled directly by init is
that except for the "actions" that have to be run on state transition
(which is what most of the discussion has apparently been concerned
about), the simple tasks of starting and stopping processes that should
be running at any given state is quite straight forward and very clearly
supported assuming you use the SysV model of daemons run from init with
"respawn" rather than BSD-style self-starting daemons.

In fact when I first made the leap of understanding about the difference
between self-starting daemons and the process of starting and
controlling daemons directly from init I was quite elated at the
elegance of it all -- one master process would both start, monitor and
re-start all daemons as well as stop them cleanly during system
shutdown.  There are no monitoring scripts to write, and no need for
start & /stop scripts, nor even really any need for daemons to
individually store their process IDs, meaning there's no chicken&egg
problem with having to start them with enhanced privileges.  Daemons
don't even have to know how to detatch themselves from a controlling tty
(because they won't have one in the first place if started by init)!
This one simple concept solves so many problems that it's really quite
amazing.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>