From 2315c9608be0518914b045fae5adbce8917ca4ff Mon Sep 17 00:00:00 2001 From: Zoran Regvart Date: Tue, 1 Sep 2026 16:07:10 +0200 Subject: [PATCH] Leave shell as PID 1 When rustguac replaces the PID 1 the shell will never invoke the trap on exit. This leaves the shell as PID 1 for the trap to be invoked on exit. (cherry picked from commit 1e31d7431206ba039fa78e96787a4278f4b4458a) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5145b70..c1824a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -232,11 +232,13 @@ fi echo "guacd started (pid=$GUACD_PID)" # Trap signals to shut down both processes -trap 'kill $GUACD_PID 2>/dev/null; wait; exit 0' TERM INT +trap 'kill $GUACD_PID 2>/dev/null; kill $RUSTGUAC_PID 2>/dev/null; wait; exit 0' TERM INT # Run rustguac in foreground echo "Starting rustguac..." -exec /opt/rustguac/bin/rustguac --config "$CONFIG_PATH" serve +/opt/rustguac/bin/rustguac --config "$CONFIG_PATH" serve +RUSTGUAC_PID=$! +wait $RUSTGUAC_PID SCRIPT RUN chmod +x /opt/rustguac/entrypoint.sh