[Pkg-xen-devel] [PATCH 04/13] xen init script: Tidy up wrong/missing Xen version error handling

Hans van Kranenburg hans at knorrie.org
Sun Feb 10 23:42:02 GMT 2019


From: Ian Jackson <ian.jackson at citrix.com>

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 at citrix.com>
---
 debian/xen-utils-common.xen.init | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/xen-utils-common.xen.init b/debian/xen-utils-common.xen.init
index b0df7be8ab..a352823040 100644
--- a/debian/xen-utils-common.xen.init
+++ b/debian/xen-utils-common.xen.init
@@ -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
-- 
2.20.1




More information about the Pkg-xen-devel mailing list