mirror of
https://github.com/casjaysdevdocker/bind
synced 2026-05-20 05:23:28 -04:00
🔧 Fix stale no_exit pid blocking restart loop 🔧
Some checks failed
bind / release-bind (push) Has been cancelled
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:
1
.claude/scheduled_tasks.lock
Normal file
1
.claude/scheduled_tasks.lock
Normal file
@@ -0,0 +1 @@
|
||||
{"sessionId":"e3874c4a-b4c6-45a3-a533-a31e6bb59f0e","pid":3227263,"procStart":"144242774","acquiredAt":1778024153040}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user