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

This commit is contained in:
Kroese
2026-07-17 19:56:05 +02:00
committed by GitHub
parent b680ff9dd8
commit 2b0b59dfba
+11 -2
View File
@@ -104,6 +104,7 @@ cleanupHelpers() {
startConsole() {
local output="${1:-/dev/tty}"
local cnt=0
local pid=""
@@ -116,7 +117,7 @@ startConsole() {
(
trap '' INT QUIT
exec nc -lU "$CONSOLE_SOCKET" </dev/tty >/dev/tty
exec nc -lU "$CONSOLE_SOCKET" </dev/tty >"$output"
) &
pid=$!
@@ -143,6 +144,13 @@ startConsole() {
return 0
}
stopConsole() {
mKill "$CONSOLE_PID"
return 0
}
finish() {
local reason=$1
@@ -283,7 +291,8 @@ graceful_shutdown() {
if (( code == 130 && SHUTDOWN_SIGNAL == code )); then
SHUTDOWN_SKIP=1
echo && info "Received SIGINT again, forcing shutdown..." return
echo && info "Received SIGINT again, forcing shutdown..."
return
fi
echo && info "Received $sig signal while already shutting down..."