From: Thomas Graf Date: Fri, 25 Jan 2013 14:06:57 +0000 (+0100) Subject: rhel: Automatically start openvswitch service before bringing an ovs interface up... X-Git-Tag: sliver-openvswitch-1.9.90-3~3^2~27 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=602453000e28ec1076c0482ce13c284765a84409 rhel: Automatically start openvswitch service before bringing an ovs interface up or down This patch modifies the ifup/ifdown scripts to automatically start the openvswitch service before ovs-vsctl is invoked thus not making it mandatory to auto-start openvswitch on boot. Signed-off-by: Thomas Graf Signed-off-by: Ben Pfaff --- diff --git a/AUTHORS b/AUTHORS index 28825d7ac..2e5552241 100644 --- a/AUTHORS +++ b/AUTHORS @@ -72,6 +72,7 @@ SUGYO Kazushi sugyo.org@gmail.com Tadaaki Nagao nagao@stratosphere.co.jp Tetsuo NAKAGAWA nakagawa@mxc.nes.nec.co.jp Thomas Goirand zigo@debian.org +Thomas Graf tgraf@redhat.com Thomas Lacroix thomas.lacroix@citrix.com Todd Deshane deshantm@gmail.com Tom Everman teverman@google.com diff --git a/rhel/etc_sysconfig_network-scripts_ifdown-ovs b/rhel/etc_sysconfig_network-scripts_ifdown-ovs index 19047d8ba..d2a2f4bb9 100755 --- a/rhel/etc_sysconfig_network-scripts_ifdown-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifdown-ovs @@ -34,6 +34,8 @@ if [ ! -x ${OTHERSCRIPT} ]; then OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth" fi +[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start + case "$TYPE" in OVSBridge) ${OTHERSCRIPT} ${CONFIG} $2 diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index b6ccf56c4..efafeada9 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -34,6 +34,8 @@ if [ ! -x ${OTHERSCRIPT} ]; then OTHERSCRIPT="/etc/sysconfig/network-scripts/ifup-eth" fi +[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start + case "$TYPE" in OVSBridge) ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}