From: Ian Campbell <Ian.Campbell@citrix.com> Date: Wed, 14 Oct 2009 10:37:19 +0000 (+0100) Subject: Ensure "service vswitch status" returns appropriate error code X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=dde98f40a3ec6f1482383bd1d6bb3e439872806b;p=sliver-openvswitch.git 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. --- 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