[Pkg-xen-changes] [xen] 01/01: Check that xenstored has actually started before talking to it.
Ian James Campbell
ijc at moszumanska.debian.org
Tue Nov 25 13:26:57 UTC 2014
This is an automated email from the git hooks/post-receive script.
ijc pushed a commit to branch feature/bug737613
in repository xen.
commit 708af2f607f1e90798580eb96d6e37a308b47649
Author: Ian Campbell <ijc at debian.org>
Date: Tue Nov 25 12:47:08 2014 +0000
Check that xenstored has actually started before talking to it.
Incorporate a timeout so as not to block boot (Mitigates #737613).
This code was taken from the upstream initscript and adapted, so it is
pretty well tested.
---
debian/changelog | 8 ++++++++
debian/xen-utils-common.xen.init | 14 ++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 484583f..4f5d464 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xen (4.4.1-4) UNRELEASED; urgency=medium
+
+ [ Ian Campbell ]
+ * Check that xenstored has actually started before talking to it.
+ Incorporate a timeout so as not to block boot (Mitigates #737613)
+
+ -- Ian Campbell <ijc at debian.org> Tue, 25 Nov 2014 12:44:03 +0000
+
xen (4.4.1-3) unstable; urgency=medium
[ Bastian Blank ]
diff --git a/debian/xen-utils-common.xen.init b/debian/xen-utils-common.xen.init
index b903877..059bd7b 100644
--- a/debian/xen-utils-common.xen.init
+++ b/debian/xen-utils-common.xen.init
@@ -193,6 +193,20 @@ xenstored_start()
start-stop-daemon --start --quiet --pidfile "$XENSTORED_PIDFILE" --exec "$XENSTORED" -- \
$XENSTORED_ARGS --pid-file="$XENSTORED_PIDFILE" \
|| return 2
+
+ # Wait for xenstored to actually come up, timing out after 30 seconds
+ local time=0
+ local timeout=30
+ while [ $time -lt $timeout ] && ! `/usr/sbin/xenstore-read -s / >/dev/null 2>&1` ; do
+ time=$(( $time+1 ))
+ sleep 1
+ done
+
+ # Exit if we timed out
+ if ! [ $time -lt $timeout ] ; then
+ return 2
+ fi
+
xenstore-write "/local/domain/0/name" "Domain-0"
xenstore-write "/local/domain/0/domid" "0"
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xen/xen.git
More information about the Pkg-xen-changes
mailing list