debuggers.hg
changeset 3020:adea3db0783f
bitkeeper revision 1.1159.168.6 (4199134cGy53S7HzqzuO4Ufm3c9ijw)
Wait for in the xend init script for Xend to really come
up. Avoids races with other init scripts.
Wait for in the xend init script for Xend to really come
up. Avoids races with other init scripts.
author | mwilli2@equilibrium.research |
---|---|
date | Mon Nov 15 20:36:28 2004 +0000 (2004-11-15) |
parents | ef156cd165a0 |
children | a4f8b0734492 3d470807adec 2bebf77dc30e |
files | tools/examples/init.d/xend |
line diff
1.1 --- a/tools/examples/init.d/xend Sat Nov 13 15:48:51 2004 +0000 1.2 +++ b/tools/examples/init.d/xend Mon Nov 15 20:36:28 2004 +0000 1.3 @@ -7,9 +7,24 @@ 1.4 # chkconfig: 2345 98 01 1.5 # description: Starts and stops the Xen control daemon. 1.6 1.7 +# Wait for Xend / Xfrd to be up 1.8 +function await_daemons_up 1.9 +{ 1.10 + i=1 1.11 + rets=10 1.12 + xend status 1.13 + while [ $? -ne 0 -a $i -lt $rets ]; do 1.14 + sleep 1 1.15 + echo -n . 1.16 + i=$(($i + 1)) 1.17 + xend status 1.18 + done 1.19 +} 1.20 + 1.21 case "$1" in 1.22 start) 1.23 xend start 1.24 + await_daemons_up 1.25 ;; 1.26 stop) 1.27 xend stop 1.28 @@ -19,6 +34,7 @@ case "$1" in 1.29 ;; 1.30 restart|reload) 1.31 xend restart 1.32 + await_daemons_up 1.33 ;; 1.34 *) 1.35 # do not advertise unreasonable commands that there is no reason