From owner-freebsd-hackers Mon Nov 30 23:15:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA24068 for freebsd-hackers-outgoing; Mon, 30 Nov 1998 23:15:53 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from lorax.ubergeeks.com (lorax.ubergeeks.com [206.205.41.241]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA24043 for ; Mon, 30 Nov 1998 23:15:46 -0800 (PST) (envelope-from adrian@lorax.ubergeeks.com) Received: from localhost (adrian@localhost) by lorax.ubergeeks.com (8.8.8/8.8.8) with SMTP id CAA05889; Tue, 1 Dec 1998 02:15:05 -0500 (EST) (envelope-from adrian@lorax.ubergeeks.com) Date: Tue, 1 Dec 1998 02:15:05 -0500 (EST) From: ADRIAN Filipi-Martin Reply-To: Adrian Filipi-Martin To: Eivind Eklund cc: rssh@grad.kiev.ua, Greg Lehey , 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?) In-Reply-To: <19981130140408.F9226@follo.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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