feat: Preserve graceful shutdown for interactive console (#1876)

This commit is contained in:
Kroese
2026-07-17 21:09:04 +02:00
committed by GitHub
parent f997e81e81
commit 810a53980f
2 changed files with 83 additions and 9 deletions
+7 -1
View File
@@ -53,13 +53,19 @@ if ! enabled "$SHUTDOWN"; then
exec "${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1
fi
"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1 &
if ! interactive; then
"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1 &
else
startConsole "$pipe"
setsid -w "${cmd[@]}" ${ARGS:+ $ARGS} </dev/null >"$pipe" 2>&1 &
fi
pid=$!
( sleep 30; boot ) &
rc=0
wait "$pid" || rc=$?
interactive && stopConsole
wait "$output" || :
[ -f "$QEMU_END" ] && exit "$rc"