WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools: init.d/xencommons: Wait for xensto

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools: init.d/xencommons: Wait for xenstored to start before setting dom0 name
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 08 Jul 2010 02:10:23 -0700
Delivery-date: Thu, 08 Jul 2010 02:11:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1277820437 -3600
# Node ID 47cf95de0ce13560c9ae6960528d3caad3a08388
# Parent  0429585d7e39220f94d677aef8cd210b5fce7e42
tools: init.d/xencommons: Wait for xenstored to start before setting dom0 name

On one of my boxes, the xenstore-write setting dom0's name starts
before xenstored is actually ready to handle the connection properly,
resulting in the name set failing.  Wait for xenstored to be up and
responding to reads before continuing, timing out after 30 seconds.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 tools/hotplug/Linux/init.d/xencommons |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletion(-)

diff -r 0429585d7e39 -r 47cf95de0ce1 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons     Tue Jun 29 15:06:27 2010 +0100
+++ b/tools/hotplug/Linux/init.d/xencommons     Tue Jun 29 15:07:17 2010 +0100
@@ -37,14 +37,32 @@ fi
 fi
 
 do_start () {
+        local time=0
+       local timeout=30
+
        if ! `xenstore-read -s / >/dev/null 2>&1`
        then
                test -z "$XENSTORED_ROOTDIR" || 
XENSTORED_ROOTDIR="/var/lib/xenstored"
                rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
                test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T 
/var/log/xen/xenstored-trace.log"
 
-               echo Starting xenstored...
+               echo -n Starting xenstored...
                xenstored --pid-file=/var/run/xenstore.pid $XENSTORED_ARGS
+
+               # Wait for xenstored to actually come up, timing out after 30 
seconds
+                while [ $time -lt $timeout ] && ! `xenstore-read -s / 
>/dev/null 2>&1` ; do
+                    echo -n .
+                   time=$(($time+1))
+                    sleep 1
+                done
+               echo
+
+               # Exit if we timed out
+               if ! [ $time -lt $timeout ] ; then
+                   echo Could not start xenstored
+                   exit 1
+               fi
+
                echo Setting domain 0 name...
                xenstore-write "/local/domain/0/name" "Domain-0"
        fi

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools: init.d/xencommons: Wait for xenstored to start before setting dom0 name, Xen patchbot-unstable <=