[ovs-dev] [PATCH 4/4] xenserver: Ensure "service openvswitch status" returns appropriate error code

Justin Pettit jpettit at nicira.com
Mon Apr 12 06:18:35 UTC 2010


This command was returning success when vswitchd was not running.  Citrix's
automated test relies on this command to decide if the host uses OVS or
not.

Based on commit dde98f4 from the xs5.7 branch written by Ian Campbell.
---
 xenserver/etc_init.d_openvswitch |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index 8b703fc..aedccea 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -430,10 +430,17 @@ case "$1" in
         strace -p $(cat "$BRCOMPATD_PIDFILE") "$@"
         ;;
     status)
-        status -p "$OVSDB_SERVER_PIDFILE" ovsdb-server &&
-        status -p "$VSWITCHD_PIDFILE" ovs-vswitchd &&
-        (test "$ENABLE_BRCOMPAT" != "y" || 
-            status -p "$BRCOMPATD_PIDFILE" ovs-brcompatd)
+        status -p "$OVSDB_SERVER_PIDFILE" ovsdb-server
+        rc=$?
+        if [ $rc -eq 0 ]; then
+            status -p "$VSWITCHD_PIDFILE" ovs-vswitchd
+            rc=$?
+        fi
+        if [ $rc -eq 0 ] && [ "$ENABLE_BRCOMPAT" = "y" ]; then
+            status -p "$BRCOMPATD_PIDFILE" ovs-brcompatd
+            rc=$?
+        fi
+        exit $rc
         ;;
     version)
         /usr/sbin/ovsdb-server -V
-- 
1.7.0.3





More information about the dev mailing list