]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen init script: Tidy up wrong/missing Xen version error handling
authorIan Jackson <ian.jackson@citrix.com>
Thu, 7 Feb 2019 16:07:03 +0000 (16:07 +0000)
committerIan Jackson <ian.jackson@citrix.com>
Fri, 22 Feb 2019 14:00:16 +0000 (14:00 +0000)
We no longer want to discard the stderr from xen-dir, and treat this
as a success.  All the reasons why this failure might previously have
been thought tolerable have been dealt with.

Specifically, we will no longer reach this code if we are not running
under Xen, or if we ran this init script on behalf of a xen-utils-V
package for some V different to the running Xen version.

We know we are running under Xen, and that either we're running not as
a result of a maint script, or as a result of a xen-utils-V maint
script for the running Xen version, or as a result of some other maint
script (of which we don't think there are any, but it presumably
expects this code to work).

So if xen-dir fails, let it print its error message, and also exit
nonzero.  And don't mention not running under Xen in our
log_warning_msg.

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
Acked-by: Hans van Kranenburg <hans@knorrie.org>
debian/xen-utils-common.xen.init

index b0df7be8abe62c3255f53af1a8c76aa93b653d60..a352823040c52d43cab276eadc272ec11c092db9 100644 (file)
@@ -53,10 +53,10 @@ xen-utils-*)                exit 0;; # xen-utils-V maintscript, but under Xen X!=V
 *)                     ;;      # maybe not under dpkg, etc.
 esac
 
-ROOT=$(/usr/lib/xen-common/bin/xen-dir 2>/dev/null)
+ROOT=$(/usr/lib/xen-common/bin/xen-dir)
 if [ $? -ne 0 ]; then
-       log_warning_msg "Not running within Xen or no compatible utils"
-       exit 0
+       log_warning_msg "No compatible Xen utils for Xen $VERSION"
+       exit 1
 fi
 
 XENCONSOLED="$ROOT"/bin/xenconsoled