Subject: Re: The new rc.d stuff...
To: Robert Elz <kre@munnari.OZ.AU>
From: Frank van der Linden <frank@wins.uva.nl>
List: current-users
Date: 03/28/2000 17:03:24
On Tue, Mar 28, 2000 at 04:50:58PM +0930, Robert Elz wrote:
> First, relatively minor, I'm using this stuff now in the IETF terminal
> room (well, right now in a meeting room) - when I started all this I
> found that the dhclient script turns out to be one of the last that
> rcorder picks to run.   That's weird - dhclient assigns the hostname
> and the addresses for the box, lots of other stuff shouldn't be being
> started until after dhcp has completed.
> 
> Of course, in a sense, that's just a trivial issue of a bug in the
> dependancy lists, and should be easy to fix.

It's the old problem of "which filesystems are mounted and from where".
dhclient wants /var/run, and /var may be mounted over the network.
However, if you use dhclient, you may want to use dhclient itself
to get on the network, so you're running around in circles.

Right now, the dhclient script assumes that /var may be mounted over
the network, so that lands it one of the last positions in the
startup order, since that makes it depend on some filesystems
being mounted, and the network having been brought up. Which
is not what you want.

> The ordering problem isn't new of course - we have had endless debates
> before about which order various things should be done in rc (especially
> in the early part of the startup sequence - when should filesystems be
> mounted compared whith when the network is started...).
> 
> If we could have some kind of dynamic dependencies (conditional dependencies
> really I suppose I mean) a lot of this would be much easier - critical
> filesystems depends upon net if /usr is nfs mounted (etc).  The condition
> needs to be a command to be run and return true/false of course.

This adds a fair amount of complexity before you know it. It's not an
easy thing to deal with. Currently, rcorder determines the order in
advance, so you can't check what may have been done before at that time.
You could make it dependent on variables set in a global conf file,
i.e. "REQUIRES: network IF var_is_networked". But that might lead
to a twisty maze of dependencies.

- Frank