Page MenuHomeFreeBSD

Enhance rc.d/netwait script to wait for late-attaching interfaces such as USB NICs.
AbandonedPublic

Authored by ian on Dec 18 2015, 1:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 8:50 AM
Unknown Object (File)
Sat, Mar 30, 11:44 PM
Unknown Object (File)
Mar 11 2024, 10:19 PM
Unknown Object (File)
Mar 11 2024, 10:19 PM
Unknown Object (File)
Mar 11 2024, 9:57 PM
Unknown Object (File)
Mar 6 2024, 12:13 AM
Unknown Object (File)
Feb 22 2024, 11:06 PM
Unknown Object (File)
Jan 10 2024, 1:32 AM
Subscribers

Details

Reviewers
None
Summary

USB network hardware may not be enumerated and available when the rc.d networking scripts run. Eventually the USB attachment completes and devd events cause the network initialization to happen, but by then other rc.d scripts have already failed, because services which depend on NETWORKING (such as mountcritremote) may end up running before the network is actually ready.

There was an existing netwait script, but because it was dependent on NETWORKING it ran too late to prevent failure of some other rc scripts. This change flips the order so that NETWORKING depends on netwait, and netwait now depends on devd and routing (the former is needed to make interfaces appear, and the latter is needed to run the ping tests in netwait).

The netwait script used to be oriented primarily towards "as soon as any host is reachable the network is fully functional", so you gave it a list of IPs to try and you could optionally name an interface and it would wait for carrier on that interface. That functionality still works the same, but now you can provide a list of interfaces to wait for and it waits until each one of them is available. The ping logic still completes as soon as the first IP on the list responds.

These changes were submitted by Brenden Molloy <brendan+freebsd@bbqsrc.net> in PR 205186, and lightly modified by me to allow a list of interfaces instead of just one.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

ian retitled this revision from to Enhance rc.d/netwait script to wait for late-attaching interfaces such as USB NICs..
ian updated this object.
ian edited the test plan for this revision. (Show Details)
ian set the repository for this revision to rS FreeBSD src repository - subversion.

review timeout, committed as r292752