[ovs-dev] [PATCH] debian: Don't recreate bridges during manual restart.

Gurucharan Shetty shettyg at nicira.com
Wed Nov 20 21:52:59 UTC 2013


Open vSwitch bridges and ports can be configured through
the /etc/network/interfaces script. During system startup,
Open vSwitch startup script reads the interfaces file
and creates the bridges and ports. During system shutdown,
the bridges and ports are removed.

The same behavior also can occur with a manual 'restart' of
Open vswitch (ex: service openvswitch-switch restart).
This behavior has come across as undesirable in some cases.
ex: When some one manually creates interfaces through ovs-vsctl
and then restarts Open vSwitch, that interface is lost.

This commit changes the startup script such that, interfaces
are created and deleted through the startup script only when
RUNLEVEL environment variable is set. This behavior will be
consistent with the OVS RHEL ifcfg-* scripts too.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 debian/openvswitch-switch.init |    1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init
index 84aa450..481b29c 100755
--- a/debian/openvswitch-switch.init
+++ b/debian/openvswitch-switch.init
@@ -31,6 +31,7 @@
 test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch
 
 network_interfaces () {
+    [ -z "${RUNLEVEL}" ] && return
     INTERFACES="/etc/network/interfaces"
     [ -e "${INTERFACES}" ] || return
     bridges=`awk '{ if ($1 == "allow-ovs") { print $2; } }' "${INTERFACES}"`
-- 
1.7.9.5




More information about the dev mailing list