Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jun 2010 01:57:52 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        Mark Stapper <stark@mapper.nl>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: network deamons starting before network!
Message-ID:  <20100618085752.GA36238@icarus.home.lan>
In-Reply-To: <4C1B32A6.6070601@mapper.nl>
References:  <4C1B2180.1040300@mapper.nl> <20100618082640.GB34578@icarus.home.lan> <4C1B32A6.6070601@mapper.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 18, 2010 at 10:47:34AM +0200, Mark Stapper wrote:
> On 18/06/2010 10:26, Jeremy Chadwick wrote:
> > On Fri, Jun 18, 2010 at 09:34:24AM +0200, Mark Stapper wrote:
> >   
> >> Hello,
> >>
> >> Since updating to 8.X I noticed that network services were started
> >> before the network was up!
> >>     
> > This is common/normal.  I wrote a script (still working on getting it
> > added to the base system) to deal with this issue.  Please see:
> >
> > http://jdc.parodius.com/freebsd/netwait
> >
> > Drop this into /usr/local/etc/rc.d, chmod it 755, and read the
> > descriptions of the variables and add the appropriate settings to
> > rc.conf.
> >
> > Please be aware netwait_if only takes a single interface; you're using
> > lagg, so I hope that when your system boots whichever interface you pick
> > in netwait_if the one which you default to using.
> >
> >   
> couldn't I use lagg0 on this parameter?

You could, but it won't necessarily work in the way you think it will.

netwait explicitly looks for link interface state ("status: no carrier")
in ifconfig output.  This methodology is used in other base system
scripts.

If lagg devices offer that line in ifconfig, then the script will work
but won't necessarily do what you expect.  It's very common on FreeBSD
for drivers of this sort to ""lie"" (please note the quotes) about the
state of link.  Meaning, lagg0 might show link, but maybe that means
"Yeah! I'm configured!" -- but that doesn't mean the *physical network
interfaces lagg0 is associated with* are actually functional.

See where I'm going with this?

In your situation, assuming lagg0 provides a status line in ifconfig,
then yes you can use that -- but *ultimately* you're going to be reliant
entirely upon the netwait_ip ping tests to verify network connections
are working.  That's just the nature of the beast.

The bottom line is that the netwait script *cannot* be reliably used in
"complex network situations" (and this may be one of those).  Below is
my original mail to -stable about the script (then called
"waitnetwork"); see "CAVEATS / POINTS OF INTEREST".  There is truly no
universal way that covers everyone's configuration/setup.

http://www.mail-archive.com/freebsd-stable@freebsd.org/msg109853.html

-- 
| Jeremy Chadwick                                   jdc@parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100618085752.GA36238>