mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
fix: Shutdown loop (#474)
This commit is contained in:
parent
fd19c7b4f3
commit
ef5b650991
20
src/power.sh
20
src/power.sh
@ -53,20 +53,16 @@ _graceful_shutdown() {
|
|||||||
while [ "$(cat $QEMU_COUNT)" -lt "$QEMU_TIMEOUT" ]; do
|
while [ "$(cat $QEMU_COUNT)" -lt "$QEMU_TIMEOUT" ]; do
|
||||||
|
|
||||||
# Try to connect to qemu
|
# Try to connect to qemu
|
||||||
if echo 'info version'| nc -q 1 -w 1 localhost "$QEMU_PORT" >/dev/null 2>&1 ; then
|
if ! echo 'info version'| nc -q 1 -w 1 localhost "$QEMU_PORT" >/dev/null 2>&1 ; then
|
||||||
|
break
|
||||||
sleep 1
|
|
||||||
|
|
||||||
# Increase the counter
|
|
||||||
cnt=$(($(cat $QEMU_COUNT)+1))
|
|
||||||
echo $cnt > "$QEMU_COUNT"
|
|
||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && info "Shutting down, waiting... ($cnt/$QEMU_TIMEOUT)"
|
|
||||||
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Increase the counter
|
||||||
|
cnt=$(($(cat $QEMU_COUNT)+1))
|
||||||
|
echo $cnt > "$QEMU_COUNT"
|
||||||
|
|
||||||
|
[[ "$DEBUG" == [Yy1]* ]] && info "Shutting down, waiting... ($cnt/$QEMU_TIMEOUT)"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$(cat $QEMU_COUNT)" -ge "$QEMU_TIMEOUT" ]; then
|
if [ "$(cat $QEMU_COUNT)" -ge "$QEMU_TIMEOUT" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user