network deamons starting before network!

Jeremy Chadwick freebsd at
Fri Jun 18 08:57:54 UTC 2010

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:
> >
> >
> >
> > 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

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.

| Jeremy Chadwick                                   jdc at |
| Parodius Networking              |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |

More information about the freebsd-stable mailing list