From 433c83b393f6f056cbb6896a5780d6c0e8129f41 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 19 Oct 2025 17:56:44 +0200 Subject: [PATCH] fix: Kill QEMU after 5 seconds if it hangs (#1088) --- src/power.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/power.sh b/src/power.sh index 08744bf..b393a7a 100644 --- a/src/power.sh +++ b/src/power.sh @@ -41,22 +41,22 @@ finish() { if [ -s "$QEMU_PID" ]; then pid=$(<"$QEMU_PID") - echo && error "Forcefully terminating QEMU process, reason: $reason..." + echo && error "Forcefully terminating Virtual DSM, reason: $reason..." { kill -15 "$pid" || true; } 2>/dev/null while isAlive "$pid"; do sleep 1 cnt=$((cnt+1)) - + # Workaround for zombie pid [ ! -s "$QEMU_PID" ] && break - + if [ "$cnt" == "5" ]; then - error "QEMU did not terminate itself, forcefully killing process..." + echo && error "QEMU did not terminate itself, forcefully killing process..." { kill -9 "$pid" || true; } 2>/dev/null fi - + done fi