fix: Display timeout

This commit is contained in:
Kroese 2023-12-19 04:30:01 +01:00 committed by GitHub
parent fafd4a4fca
commit 3bcd831531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ set -Eeuo pipefail
# Configure QEMU for graceful shutdown # Configure QEMU for graceful shutdown
QEMU_PORT=7100 QEMU_PORT=7100
QEMU_TIMEOUT=50 QEMU_TIMEOUT=55
QEMU_PID="/run/qemu.pid" QEMU_PID="/run/qemu.pid"
QEMU_COUNT="/run/qemu.count" QEMU_COUNT="/run/qemu.count"
@ -67,6 +67,10 @@ _graceful_shutdown() {
done done
if [ "$(cat $QEMU_COUNT)" -ge "$QEMU_TIMEOUT" ]; then
echo && error "Shutdown timeout reached, forcefully quitting.."
fi
echo && echo " Quitting..." echo && echo " Quitting..."
echo 'quit' | nc -q 1 -w 1 localhost "$QEMU_PORT" >/dev/null 2>&1 || true echo 'quit' | nc -q 1 -w 1 localhost "$QEMU_PORT" >/dev/null 2>&1 || true