Subject: Re: startup files (was Re: Updating /etc... )
To: None <perry@piermont.com>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: current-users
Date: 12/24/1995 18:35:26
> 2) I think that people generally agree that run levels aren't
>    something we want in NetBSD.

Some people want run-levels but that is a separate issue.  We can
easily have the rc.d/* (or whatever we call it) stuff now, and argue
about run-levels later.

> 3) I think that people generally agree that people want flexibility,
>    so it is better if the rc.d style thing gets invoked by rc via a
>    shell mechanism and is not built in to init -- ditto that people

Cool.  

Even if you do introduce run-levels at a later date, you can still
have init just invoke /etc/rc with some means of determining current
and desired or old and new run-levels.  There should be no arbitrary
limit.

>    aren't really in to shutdown scripts.

If you are not going to have run-levels (I think they are useful but
I've lived for years without them so no big deal), then shutdown
scripts are more useful.  If you have run-levels then shutdown hooks
can be handled that way.  In any case its a trivial exercise to

mv shutdown shutdown.real
and have a shutdown that processes shutdown.d/* then execs
shutdown.real.

That's what I do for most boxes.  Databases _need_ to be shut down.  

> 4) I think that people generally agree that we need a better mechanism
>    to solve the ordering problem for scripts -- you really want to be
>    able to say "start this thing after dns and nfs are up", etc.

I personally don't see this as a big issue.  If we did rc.d or
whatever with say 3 digit numbers and well known blocks for important
services (I think I saw a message from cgd on this point), then it
would be trivial to know that if you want your install script to be
run after a network if any is up, but before local daemons, then add a
link to it as S400foo.

Hey, use 4 digit numbers... the shell can cope.

> 4) Is the only problem that I think is hard, and I believe that by
> having an explicit dependency list in each script file, we can
> probably have some code produce an ordering based on dependencies
> rather than trying to do this by kludges like putting numbers in front
> of the scripts.

But putting numbers in front of scripts is trivially easy, and solves
at least 90% of the problem.  I'm all in favour of expending the least
effort for the most gain.

May things SysV'ish suck mud.  But that's usually due to the
implementation - not the concept. 

Even if you think it sucks and that a better way is needed,
/etc/rc.d/Snnn* is just so easy and effective that we could implement
it right away and those that care can invent a magic tool to
automagically create the content of /etc/rc.d with links to the
correct scripts.  Personally though I probably would not want some
tool re-configuring my system for me.

--sjg