[ovs-dev] [PATCH 2/3] Debian: fail gracefully if modules can't be loaded

Simon Horman horms at verge.net.au
Tue Sep 6 00:35:48 UTC 2011


When starting openvswtich-vswitch fail gracefully if
modules can't be loaded. Otherwise package install will
fail if the openvswitch_mod modules is not available.

This resolves a regression between 1.1.1 and 1.2.1.

This makes use of the load-kmod subcommand which was
added to ovs-ctl for this purpose.
---
 debian/openvswitch-switch.init |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init
index 3487afb..25502e3 100755
--- a/debian/openvswitch-switch.init
+++ b/debian/openvswitch-switch.init
@@ -42,6 +42,17 @@ ovs_ctl () {
 }
 
 start () {
+    if ! ovs_ctl load-kmod; then
+	echo "Module has probably not been built for this kernel."
+        if ! test -d /usr/share/doc/openvswitch-datapath-source; then
+	    echo "Install the openvswitch-datapath-source package, then read"
+	    echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
+	else
+            echo "For instructions, read"
+	    echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
+	fi
+        exit 0
+    fi
     set ovs_ctl ${1-start} --system-id=random
     if test X"$FORCE_COREFILES" != X; then
 	set "$@" --force-corefiles="$FORCE_COREFILES"
-- 
1.7.5.4




More information about the dev mailing list