[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] stubdom: make stubdom-dm exit properly



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1256825085 0
# Node ID 521fa89e0d3ee413dc7dc2b63e11129bfddb2a69
# Parent  444ac8fdb591ade353fc265b82e769f7b82da310
stubdom: make stubdom-dm exit properly

The built-in bash command wait should be able to take a pid argument
and just wait for the specified process to die, but it currently has a
bug and what actually does is waiting for the death of all the
children.  For this reason the stubdom-dm script doesn't exit properly
after stubdom destruction.  This patch solves the issue spawning only
one child, removing the sleep subprocess workaround that was used to
create a usable stdin for "xm console" and replacing it with a fifo.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 stubdom/stubdom-dm |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff -r 444ac8fdb591 -r 521fa89e0d3e stubdom/stubdom-dm
--- a/stubdom/stubdom-dm        Thu Oct 29 14:03:56 2009 +0000
+++ b/stubdom/stubdom-dm        Thu Oct 29 14:04:45 2009 +0000
@@ -80,8 +80,8 @@ done
 # Termination handler
 
 term() {
-    kill %1
     [ -n "$vncpid" ] && kill -9 $vncpid
+    rm -f /tmp/domname-dm
     rm ${stubdom_configdir}/$domname-dm
     exit 0
 }
@@ -154,11 +154,10 @@ do
     j=$(( $j + 1 ))
 done
 echo " ] " >> ${stubdom_configdir}/$domname-dm
-creation="xm create -c ${stubdom_configdir}/$domname-dm target=$domid 
memory=32 extra=\"$extra\""
 
-(while true ; do sleep 60 ; done) | /bin/sh -c "$creation" &
-#xterm -geometry +0+0 -e /bin/sh -c "$creation ; echo ; echo press ENTER to 
shut down ; read" &
-consolepid=$!
+mkfifo /tmp/$domname-dm
+xm create -c ${stubdom_configdir}/$domname-dm target=$domid memory=32 
extra="$extra" < /tmp/$domname-dm &
+exec 4>/tmp/$domname-dm
 
 
 ###########
@@ -178,6 +177,6 @@ fi
 fi
 
 # wait for SIGHUP or stubdom termination
-wait $consolepid
+wait
 
 term

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.