diff --git a/tools/build_libvirt.sh b/tools/build_libvirt.sh index f24f726..b9cd4c3 100755 --- a/tools/build_libvirt.sh +++ b/tools/build_libvirt.sh @@ -406,7 +406,7 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ]; then sleep 1 done - tail -n +1 -F $VM_DIR/console.log & + tail -F $VM_DIR/console.log & TAIL_PID=$! @@ -418,11 +418,15 @@ if [ "$WAIT_TILL_LAUNCH" = "1" ]; then # Let Ctrl-c kill tail and exit trap kill_tail SIGINT + set +o xtrace + echo "Waiting stack.sh to finish..." while ! cat $VM_DIR/console.log | grep -q 'All done' ; do - sleep 5 + sleep 1 done + set -o xtrace + kill $TAIL_PID if grep -q "stack.sh failed" $VM_DIR/console.log; then