From dde98f40a3ec6f1482383bd1d6bb3e439872806b 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. --- xenserver/etc_init.d_vswitch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch index e56c0226b..74162dcee 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_vswitch @@ -319,9 +319,12 @@ case "$1" in ;; status) status -p ovs-vswitchd.pid ovs-vswitchd - if [ "$ENABLE_BRCOMPAT" = "y" ] ; then + rc=$? + if [ $rc -eq 0 ] && [ "$ENABLE_BRCOMPAT" = "y" ] ; then status -p ovs-brcompatd.pid ovs-brcompatd + rc=$? fi + exit $rc ;; version) /usr/sbin/ovs-vswitchd -V -- 2.47.0