From fd21e09923e7fbb2ebbd9a28ee8f9ff409c5c928 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. --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45e7f54..e4e7790 100644 --- a/Dockerfile +++ b/Dockerfile @@ -224,11 +224,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