summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackware.com>2018-11-26 01:55:19 -0600
committerRobby Workman <rworkman@slackware.com>2018-11-26 02:04:37 -0600
commit405fad2f281900312b2d6e39269a5f44f94ae5d8 (patch)
tree6f4bb811e5589238bb24ce7fd5221332c26f76a1
parent19e8dd5af1cb12f2118f2210e45cd93beaf0a8c9 (diff)
downloadslacknetsetup-405fad2f281900312b2d6e39269a5f44f94ae5d8.tar.xz
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.
-rw-r--r--rc.inet17
1 files changed, 6 insertions, 1 deletions
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 #