From 9a117f4fb09f57e7f97165b82e0f2635163dfe91 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 17 Apr 2023 19:01:28 +0200 Subject: [PATCH] Shutdown --- run/power.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run/power.sh b/run/power.sh index f48b25b..b49cc8a 100644 --- a/run/power.sh +++ b/run/power.sh @@ -32,7 +32,7 @@ _graceful_shutdown(){ # Don't send the powerdown signal because vDSM ignores ACPI signals # echo 'system_powerdown' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null - # Send shutdown command instead via serial port + # Send shutdown command to host via serial port RESPONSE=$(curl -s -m 2 -S http://127.0.0.1:2210/write?command=6 2>&1) if [[ ! "${RESPONSE}" =~ "\"success\"" ]] ; then @@ -40,6 +40,8 @@ _graceful_shutdown(){ echo echo "Could not send shutdown command to guest, error: $RESPONSE" + # If we cannot shutdown the usual way, fallback to the NMI method + AGENT_VERSION=1 AGENT="${STORAGE}/${BASE}.agent" [ -f "$AGENT" ] && AGENT_VERSION=$(cat "${AGENT}")