From 405fad2f281900312b2d6e39269a5f44f94ae5d8 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Mon, 26 Nov 2018 01:55:19 -0600 Subject: If modprobe events occurred, sleep for a bit after they finished This is ugly, but it beats doing the sleep regardless of whether there's any need for it and causing folks to whine about two seconds of loss in boot time. --- rc.inet1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc.inet1 b/rc.inet1 index 9eb5655..9a6fd61 100644 --- a/rc.inet1 +++ b/rc.inet1 @@ -59,6 +59,7 @@ for i in "${IFNAME[@]}"; do if /sbin/modprobe -c | grep -v "^#" | grep -w "alias ${i%%:*}" | grep -vw "alias ${i%%:*} off" >/dev/null; then echo "/etc/rc.d/rc.inet1: /sbin/modprobe ${i%%:*}" | $LOGGER /sbin/modprobe ${i%%:*} + _DID_MODPROBE=1 fi fi done @@ -67,8 +68,12 @@ done # set to 0 before that happens, so try to pre-load ipv6 here. if [ ! -e /proc/sys/net/ipv6 ]; then /sbin/modprobe ipv6 + _DID_MODPROBE=1 fi -sleep 1 +# If we did any module loading in the blocks above, sleep for a couple of +# seconds to give time for everything to "take" +[ -n "${_DID_MODPROBE}" ] && sleep 2 +unset _DID_MODPROBE ###################### # LOOPBACK FUNCTIONS # -- cgit v1.2.3