From 597114e2f3d4501043ea8b41a71b5c805b0e5941 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Tue, 20 Oct 2026 15:44:14 -0700 Subject: [PATCH] fix(entrypoint): exec memcached so docker stop is graceful entrypoint.sh ran memcached in the foreground under bash. bash as PID 1 has no SIGTERM handler, so the kernel dropped docker stop's SIGTERM; docker waited the full 10s timeout and SIGKILLed the container (exit 137). exec memcached so it becomes PID 1; it installs its own SIGTERM/SIGINT handlers and exits at once. Co-Authored-By: Claude Opus 5.5 --- scripts/entrypoint.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b5fd512..f7735da 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,6 +1,8 @@ #!/bin/bash echo "Starting Memcached..." sleep 5 -/usr/bin/memcached -u memcached -l 0.0.0.0 - -exit 0 \ No newline at end of file +# exec so memcached replaces bash as PID 1. bash as PID 1 has no SIGTERM +# handler, so the kernel dropped `docker stop`'s SIGTERM and docker SIGKILLed +# the container after the full 10s timeout (exit 137). memcached installs its +# own SIGTERM/SIGINT handlers, so as PID 1 it shuts down immediately. +exec /usr/bin/memcached -u memcached -l 0.0.0.0