🔧 Fix stale no_exit pid blocking restart loop 🔧
Some checks failed
bind / release-bind (push) Has been cancelled

- Re-enter the monitor loop when /run/.no_exit.pid is left from a prior container life
- Only short-circuit when the recorded PID is still alive via kill -0
- Remove leftover pid file so the supervisor exec path runs on restart

.claude/scheduled_tasks.lock
rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
casjay
2026-05-05 20:19:32 -04:00
parent 8c510016c3
commit b9f5848f3b
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1 @@
{"sessionId":"e3874c4a-b4c6-45a3-a533-a31e6bb59f0e","pid":3227263,"procStart":"144242774","acquiredAt":1778024153040}

View File

@@ -280,7 +280,16 @@ __no_exit() {
local failed_services=""
local failure_count=0
[ -f "/run/.no_exit.pid" ] && return 0
# only return early if the recorded PID is still alive; a leftover
# pid file from a prior container life (docker restart) would otherwise
# cause us to exit instead of entering the monitor loop.
if [ -f "/run/.no_exit.pid" ]; then
no_exit_pid="$(cat /run/.no_exit.pid 2>/dev/null)"
if [ -n "$no_exit_pid" ] && kill -0 "$no_exit_pid" 2>/dev/null; then
return 0
fi
rm -f /run/.no_exit.pid 2>/dev/null || true
fi
exec bash -c "
trap 'echo \"Container shutdown requested\"; rm -f /run/.no_exit.pid /run/*.pid; exit 0' TERM INT