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 1e31d74312)
This commit is contained in:
Zoran Regvart
2026-09-01 16:07:10 +02:00
committed by Dave Kempe
parent bc9e8c6017
commit 2315c9608b
+4 -2
View File
@@ -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