[ovs-dev] [PATCH 2/2] debian: Use restart --save-flows=yes during postinst.

Gurucharan Shetty gshetty at nicira.com
Wed Oct 24 21:21:40 UTC 2012


When debian package for openvswitch-switch is upgraded,
restart the daemons using the "--save-flows=yes" flag.
This will save the openflow flows in vswitchd and
re-apply it after the upgrade.

Feature #13555.
Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 debian/openvswitch-switch.postinst |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/debian/openvswitch-switch.postinst b/debian/openvswitch-switch.postinst
index 7b9d7bc..548ce1e 100755
--- a/debian/openvswitch-switch.postinst
+++ b/debian/openvswitch-switch.postinst
@@ -49,6 +49,18 @@ esac
 OVS_MISSING_KMOD_OK=yes
 export OVS_MISSING_KMOD_OK
 
-#DEBHELPER#
+if [ -x "/etc/init.d/openvswitch-switch" ]; then
+update-rc.d openvswitch-switch defaults >/dev/null
+	if [ -n "$2" ]; then
+		_dh_action="restart --save-flows=yes"
+	else
+		_dh_action=start
+	fi
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d openvswitch-switch $_dh_action || exit $?
+	else
+		/etc/init.d/openvswitch-switch $_dh_action || exit $?
+	fi
+fi
 
 exit 0
-- 
1.7.9.5




More information about the dev mailing list