From: Gurucharan Shetty Date: Wed, 20 Nov 2013 21:43:45 +0000 (-0800) Subject: debian: Don't recreate bridges during manual restart. X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=b2a0daa5bdbb4594d778a6feb9a108128428142c debian: Don't recreate bridges during manual restart. 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 Acked-by: Ben Pfaff --- diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 84aa45035..481b29c99 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}"`