Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 1998 02:15:05 -0500 (EST)
From:      ADRIAN Filipi-Martin <adrian@ubergeeks.com>
To:        Eivind Eklund <eivind@yes.no>
Cc:        rssh@grad.kiev.ua, Greg Lehey <grog@lemis.com>, dyson@iquest.net, wes@softweyr.com, tlambert@primenet.com, hackers@FreeBSD.ORG
Subject:   Re: System V init (was: Linux to be deployed in Mexican schools; Where was FreeBSD?)
Message-ID:  <Pine.BSF.3.96.981201015637.4238K-100000@lorax.ubergeeks.com>
In-Reply-To: <19981130140408.F9226@follo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 30 Nov 1998, Eivind Eklund wrote:

> On Mon, Nov 30, 1998 at 03:04:18AM +0000, Ruslan Shevchenko wrote:
> > for FreeBSD, I think, ideally is to have explicit graph of dependences,
> > in some form, where init-states is marks of nodes on it, and during
> > init close all nodes which have rank biggest then argument.
> 
> I posted code to do this a week ago.
> 
> 	http://www.freebsd.org/~eivind/newrc.tar.gz
> 
> This include a (somewhat raw) rewrite of the functionality in rc to
> the new scheme.
> 
> Eivind.

	Well, I took a look.  It seems that most of what we are arguing
about has little bearing on your implementation.  No start/stop scripts
nor run-levels. 

	While your code no doubt works and does the right think, I see two
problems with it.  First, it cannot be flipped through and explained in
less than 10 minutes.  While I can parse that fancy for-loop in the rc, I
think this would send any newbie screaming for their mother.  The old rc's
aren't that opaque.  

	Second, the dynamic ordering of dependencies is nice, but having
the ordering information spread accross every file in rc.d makes it very
hard to speak with authority on just what is going to happen and in what
order.  Pulling this ordering information up into a central place would be
much prefered.  I also content that it would be more maintainable over the
long haul. 

	I'd argue more for maintaining a list of rc's to run in rc.conf or
the top level rc itself.  Something like the following:

scripts=""
scripts="${scripts} ccdconfig"
scripts="${scripts} swapon"
scripts="${scripts} autoboot"
scripts="${scripts} mount_root"
scripts="${scripts} mount_local"
scripts="${scripts} start_net"
scripts="${scripts} mount_nfs"
...
scripts="${scripts} rc.local"

for i in ${scripts}; do
    /etc/rc.d/$i start
done

	The order of execution is easily grasped.  For rc.shutdown, all
you need to do is reverse the list and loop with "stop" as the argument.

	If you still want to do a tsort, add the before and after values
at this level, where they are easily understood.  At least then the
dependencies are quicker to see.

	Adrian
--
[ adrian@ubergeeks.com -- Ubergeeks Consulting -- http://www.ubergeeks.com/ ]


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981201015637.4238K-100000>