diff options
author | mwilli2@equilibrium.research <mwilli2@equilibrium.research> | 2004-11-15 20:36:28 +0000 |
---|---|---|
committer | mwilli2@equilibrium.research <mwilli2@equilibrium.research> | 2004-11-15 20:36:28 +0000 |
commit | 0182092bce65369d4ae079d71b4d4a7143af68d0 (patch) | |
tree | 18768bed781408830073c6ed58a9d2cf6c738ac0 /tools | |
parent | a8056c42f6ba609e6de06c4e5fbf637b1153f3bb (diff) | |
download | xen-0182092bce65369d4ae079d71b4d4a7143af68d0.tar.gz xen-0182092bce65369d4ae079d71b4d4a7143af68d0.tar.bz2 xen-0182092bce65369d4ae079d71b4d4a7143af68d0.zip |
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.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/examples/init.d/xend | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/examples/init.d/xend b/tools/examples/init.d/xend index 7037848166..39324c7930 100755 --- a/tools/examples/init.d/xend +++ b/tools/examples/init.d/xend @@ -7,9 +7,24 @@ # chkconfig: 2345 98 01 # description: Starts and stops the Xen control daemon. +# Wait for Xend / Xfrd to be up +function await_daemons_up +{ + i=1 + rets=10 + xend status + while [ $? -ne 0 -a $i -lt $rets ]; do + sleep 1 + echo -n . + i=$(($i + 1)) + xend status + done +} + case "$1" in start) xend start + await_daemons_up ;; stop) xend stop @@ -19,6 +34,7 @@ case "$1" in ;; restart|reload) xend restart + await_daemons_up ;; *) # do not advertise unreasonable commands that there is no reason |