From a1864c5f89fcbec040703e46c709a4799ef72f0b Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 14 Oct 2009 11:37:19 +0100 Subject: [PATCH] Ensure "service vswitch status" returns appropriate error code This command was returning success when vswitchd was not running. Our automated test relies on this command to decide if the host uses vswitch or not. If vswitchd is not OK then brcompatd is not checked at all. Since the return codes apparently have specific meanings I couldn't see a sensible way to combine multiple failure results. (Cherry-picked from xs5.7 branch by Ben Pfaff but merge conflicts meant that the whole thing had to be redone.) --- xenserver/etc_init.d_openvswitch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 0101562f..fe8360fe 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -423,11 +423,10 @@ case "$1" in strace -p $(cat "$BRCOMPATD_PIDFILE") "$@" ;; status) - status -p "$OVSDB_SERVER_PIDFILE" ovsdb-server - status -p "$VSWITCHD_PIDFILE" ovs-vswitchd - if [ "$ENABLE_BRCOMPAT" = "y" ] ; then - status -p ovs-brcompatd.pid ovs-brcompatd - fi + status -p "$OVSDB_SERVER_PIDFILE" ovsdb-server && + status -p "$VSWITCHD_PIDFILE" ovs-vswitchd && + (test "$ENABLE_BRCOMPAT" != "y" || + status -p "$BRCOMPATD_PIDFILE" ovs-brcompatd) ;; version) /usr/sbin/ovsdb-server -V -- 2.30.2