Is there a better way to ensure that an ethernet port is configured before continuing through startup init scripts? When 802.3ad bonded ethernet is configured on Ubuntu, it takes some time before it finishes protocol negotiation and starts passing packets, because the networking script just configures, but does not verify that traffic is being passed. As a result, this can throw off some of the other network dependent scripts, like the init for drbd. Right now, I just have a loop that pings the gateway in a startup script, but this seems less than optimal:
GATEWAYIP=10.0.0.1
while ( ! ping -c 1 $GATEWAYIP ); do
echo gateway not up
done
This is a pretty specific use case you have with DRBD in line after networking. As I don't have much DRBD experience, I'm not sure how fast it will try to establish. Perhaps you could get by with simply detecting when the IP is bound to the interface instead of waiting until a ping responds (which adds that latency to the mix).
Perhaps something like;
I suppose outside of debugging the above script would make more sense calling a sleep for a time duration rather then echoing it's output.
If this still isn't quite what you want, perhaps there is something to be done in NetworkManager or maybe trying to detect the link state (carrier sense). Hope I was some help.