From cfa9bf12e1fda7733e83dffbe14b2eecbf9a9813 Mon Sep 17 00:00:00 2001 From: Brian Kruger Date: Wed, 9 May 2012 09:13:42 -0700 Subject: rhel: Add timeouts to network scripts. If the daemon(s) aren't running for whatever reason, the RHEL ovs ifup/ifdown scripts don't take that into account and an attempt to reboot a system could take forever. (literally. endless loop!) Here are a couple of patches (one of ifup, one for ifdown) to add timeouts (10 seconds), because it runs per interface you have configured and that could take awhile to reboot a system if needed. Signed-off-by: Brian Kruger [blp@nicira.com fixed up a conflict against master] Signed-off-by: Ben Pfaff --- rhel/etc_sysconfig_network-scripts_ifup-ovs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'rhel/etc_sysconfig_network-scripts_ifup-ovs') diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index b800ce050..c42787903 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -22,6 +22,7 @@ cd /etc/sysconfig/network-scripts [ -f ../network ] && . ../network CONFIG=${1} +TIMEOUT=10 need_config ${CONFIG} @@ -35,7 +36,7 @@ fi case "$TYPE" in OVSBridge) - ovs-vsctl -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then case " ${OVSDHCPINTERFACES} " in *" ${OVSINTF} "*) @@ -50,12 +51,12 @@ case "$TYPE" in OVSPort) /sbin/ifup "$OVS_BRIDGE" ${OTHERSCRIPT} ${CONFIG} ${2} - ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE" ;; OVSIntPort) /sbin/ifup "$OVS_BRIDGE" - ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA} + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA} ${OTHERSCRIPT} ${CONFIG} ${2} ;; OVSBond) @@ -63,7 +64,7 @@ case "$TYPE" in for _iface in $BOND_IFACES; do /sbin/ifup ${_iface} done - ovs-vsctl -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} + ovs-vsctl -t ${TIMEOUT} -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} ${OTHERSCRIPT} ${CONFIG} ${2} OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE" ;; -- cgit v1.2.1