From d8b2a184255cd01068caeaca5b7053d0f8a1b8bd Mon Sep 17 00:00:00 2001 From: Shanyu Thibaut Juneja Date: Wed, 11 Mar 2026 11:20:05 -0700 Subject: [PATCH] simplify entrypoint --- containers/docker-entrypoint.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/containers/docker-entrypoint.sh b/containers/docker-entrypoint.sh index a376d9e6..4fdfb90d 100644 --- a/containers/docker-entrypoint.sh +++ b/containers/docker-entrypoint.sh @@ -333,22 +333,5 @@ done echo "✅ Container ready" -# --------------------------------------------------------------------------- -# Instead of exec (which orphans background processes), run the user command -# and then wait so that the entrypoint stays alive as PID 1 to reap children. -# --------------------------------------------------------------------------- cd /workspace -if [ $# -gt 0 ]; then - "$@" & - CMD_PID=$! - echo "Started user command (PID $CMD_PID): $*" - - # Forward SIGTERM/SIGINT to all children for graceful shutdown - trap 'echo "Shutting down..."; kill $CMD_PID $TOOL_SERVER_PID $WATCHDOG_PID ${CHROMIUM_PID:-0} ${SOCAT_PID:-0} ${CAIDO_PID:-0} 2>/dev/null; wait' SIGTERM SIGINT - - wait $CMD_PID -else - # No command: just keep running (wait on tool server) - trap 'echo "Shutting down..."; kill $TOOL_SERVER_PID $WATCHDOG_PID ${CHROMIUM_PID:-0} ${SOCAT_PID:-0} ${CAIDO_PID:-0} 2>/dev/null; wait' SIGTERM SIGINT - wait $TOOL_SERVER_PID -fi +exec "$@"