aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-04-18 20:11:45 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-04-18 20:11:45 +0000
commit747e9db1604cc27ec2ab15e829656172f1986ab4 (patch)
tree6e4b75432bdcb04b80fef1ac7b027d2d4dbc893e
parentaf200403194358a1093a6ab495ec92aaefdb8fee (diff)
downloadinitscripts-747e9db1604cc27ec2ab15e829656172f1986ab4.tar
initscripts-747e9db1604cc27ec2ab15e829656172f1986ab4.tar.gz
initscripts-747e9db1604cc27ec2ab15e829656172f1986ab4.tar.bz2
initscripts-747e9db1604cc27ec2ab15e829656172f1986ab4.tar.xz
initscripts-747e9db1604cc27ec2ab15e829656172f1986ab4.zip
Add NETWORKDELAY and LINKDELAY (#176851)
-rwxr-xr-xrc.d/init.d/network4
-rw-r--r--sysconfig.txt13
-rwxr-xr-xsysconfig/network-scripts/ifup7
3 files changed, 21 insertions, 3 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 535fbf58..e2060ae0 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -177,7 +177,9 @@ case "$1" in
sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
touch /var/lock/subsys/network
- ;;
+
+ [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY}
+ ;;
stop)
# If this is a final shutdown/halt, check for network FS,
# and unmount them even if the user didn't turn on netfs
diff --git a/sysconfig.txt b/sysconfig.txt
index e7dc860a..b380d0e7 100644
--- a/sysconfig.txt
+++ b/sysconfig.txt
@@ -177,6 +177,11 @@ Files in /etc/sysconfig
All the IPX stuff is optional, and should default to off.
+ NETWORKDELAY=<delay in seconds>
+ Delay in seconds after all network interfaces are initialized. Useful if
+ network has spanning tree running and must wait for STP convergence.
+ Default: 0 (no delay)
+
NETWORKING_IPV6=yes|no
Enable or disable global IPv6 initialization
Default: no
@@ -666,7 +671,13 @@ Files in /etc/sysconfig/network-scripts/
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
Note that changing speed or duplex settings almost always
requires disabling autonegotiation with 'autoneg off'.
-
+ LINKDELAY=<time in seconds>
+ Time that the system should pause after the specific interface is
+ enabled. This may be useful if one interface is connected to a
+ switch which has spanning tree enabled and must wait for STP to
+ converge before the interface should be considered usable.
+ Supported only with BOOTPROTO=none.
+
No longer supported:
PROMISC=yes|no (enable or disable promiscuous mode)
ALLMULTI=yes|no (enable or disable all-multicast mode)
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index a4c3934d..43fbf1c5 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -189,8 +189,9 @@ fi
if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then
/sbin/ip addr flush dev ${DEVICE} 2>/dev/null
/sbin/ip link set dev ${DEVICE} up
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
/usr/sbin/brctl addif ${BRIDGE} ${DEVICE}
- # Upon adding a device to a bridge,
+ # Upon adding a device to a bridge,
# it's necessary to make radvd reload its config
[ -r /var/run/radvd/radvd.pid ] && kill -HUP `cat /var/run/radvd/radvd.pid`
exit 0
@@ -230,6 +231,7 @@ fi
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
/sbin/ip link set dev ${DEVICE} down
/sbin/ip link set dev ${DEVICE} up
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
if [ "$BOOTPROTO" = "dhcp" ]; then
/sbin/ifup ${device##*/}
@@ -351,6 +353,7 @@ else
if [ -n "$ETHTOOL_OPTS" ] ; then
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
# Bonding initialization part II
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then
for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
@@ -378,6 +381,8 @@ else
/sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS
fi
+ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY}
+
if ! arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then
echo $"Error, some other host already uses address ${IPADDR}."
exit 1