Subject: Re: [vserver] gentoo and baselayout 2
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Tue, 4 Sep 2007 17:30:10 +0200

On Sat, Sep 01, 2007 at 01:31:40PM -0700, Gregory M. Turner wrote:
> On Saturday 01 September 2007, Gregory M. Turner wrote:
> > On Thursday 30 August 2007, Ed W wrote:
> [snip]
> > > I thought this was something I created off my own back to work around
> > > these issues, but then you pasted in exactly the same file and now I
> > > doubt myself... Seems coincidental we both came up with the same hack?
> >
> > Sorry, I was being either cryptic or stupid above.  That was just a
> > diffdump of what was in my tree versus vanilla, including, I see, mostly
> > bugs.  But, somewhere in that mess, there might be something that makes a
> > difference, i.e.:
> >
> > diff -ur ./etc/conf.d/rc /etc/conf.d/rc
> > --- ./etc/conf.d/rc     2007-08-27 20:46:32.000000000 +0000
> > +++ /etc/conf.d/rc      2007-08-24 16:38:30.000000000 +0000
> > @@ -26,7 +26,7 @@
> >  # both will be started, but services that depend on 'net' will work if
> > either # one comes up. With RC_DEPEND_STRICT="yes" we would require them
> > both to # come up.
> > -RC_DEPEND_STRICT="yes"
> > +RC_STRICT_DEPEND="no"
> >
> >  # Do we allow services to be hotplugged? If not, set to RC_HOTPLUG="no"
> >  # NOTE: This does not affect anything hotplug/udev/devd related, just the
> > --
> >
> > Which might have enabled my vserver to boot by relaxing some dependency
> > checking in the init system (as you can see, this patch apparently also
> > introduces a bug by renaming RC_DEPEND_STRICT).
> >
> > If you are referring generally to links between net.lo and net.XXX in
> > the /etc/init.d directory, AFAIK that is the Official Gentoo Way (tm) to
> > wedge network interfaces into the init system... so maybe as you originally
> > guessed, you created it manually (while following a guide).
> 
> I still don't think the above is clear. ignore that for now. Here's
> what I'm getting at:
>
> As far as I know, Gentoo net* init scripts work something like:
>
> exogenous) Gentoo init system runs 0. Gentoo decides that
> /etc/init.d/net.X should run. 
>  1. net.X happens to be a symlink to /lib/rcscripts/sh/net.sh 
>  2. /lib/rcscripts/sh/net.sh reads network settings from 
>     /etc/conf.d/net.X or /etc/conf.d/net 
>  3. ? 
>  4. something networky happens (i.e., "ifconfig $(a-bunch-of-args)")
>
> The fundamental problem if I understand, is that #4 shouldn't occur   
> because (a) vserver-utils put up the interface before gentoo init     
> runs and (b) something bad will happen if the vserver "guest" tries   
> to touch network hardware. 

well, nothing 'bad' will happen from the Linux-VServer
PoV, but the scripts might consider being unable to 
do what they have been designed for 'BAD' and simply
abort with a failure .. which might be quite bad for
the guest startup itself ...

best,
Herbert

> It seems to me that deviating during step #3 is the best solution but 
> as you can see above I haven't looked into it carefully :)            
>
> I found it interesting, however, that my setup (since killed) was
> working, somehow, without changing the vanilla versions of the init.d
> script (which is why I documented it). There is certainly nothing
> wrong with fixing it at step #1 as you have; in fact this is probably
> the best solution for the case where all networking is set up by the
> vserver-utils.
> 
> -- 
> gmt