Wait for carrier in /etc/rc.d/defaultroute

Ed Maste emaste at freebsd.org
Tue Sep 28 02:20:45 UTC 2010


On Sat, Sep 25, 2010 at 01:31:05PM -0500, Brooks Davis wrote:

> On Fri, Sep 24, 2010 at 08:04:35PM -0400, Ed Maste wrote:
>
> > The attached patch introduces a defaultroute_carrier_delay variable
> > and a change to /etc/rc.d/defaultroute to wait that long before bailing
> > out if there are no interfaces with carrier.  With the default settings
> > defaultroute will wait for five seconds to see if any interface gets 
> > carrier.  The original 30 second wait for a default route to appear is
> > unchanged.
> > 
> > Any comments?  I'll commit it sometime next week if there's no concern.
> 
> This seems like a reasionable solution.  Just checking for carrier
> didn't work as well as I'd hoped.  Have you tested this on a bridge or
> similar interface?

No, I've tested only on physical interfaces.  The logic for detecting
carrier is unchanged from what was there though, so I wouldn't expect
any significant change.

> It seems like in some senses there's probably something more the nic
> could be telling us about it's state so we could do a better job here.
> What we really want to know is if we have any dhcp interfaces that have
> a chance of getting a lease any time soon so if the interface could say "I think I've got a
> cable attached" that would be useful.

I agree, but that's not a project I'm ready to take on at the moment :)

I wonder how (if) other operating systems handle this.

-Ed


More information about the freebsd-rc mailing list