[ovs-dev] [PATCH 1.7] rhel: Automatically start openvswitch service before bringing an ovs interface up or down
Thomas Graf
tgraf at redhat.com
Fri Jan 25 14:06:57 UTC 2013
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 <tgraf at redhat.com>
---
rhel/etc_sysconfig_network-scripts_ifdown-ovs | 2 ++
rhel/etc_sysconfig_network-scripts_ifup-ovs | 2 ++
2 files changed, 4 insertions(+)
diff --git a/rhel/etc_sysconfig_network-scripts_ifdown-ovs b/rhel/etc_sysconfig_network-scripts_ifdown-ovs
index 19047d8..d2a2f4b 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 c427879..61b0af9 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}
--
1.7.11.7
More information about the dev
mailing list