diff --git a/packages/mosaic/framework/tools/wake/detector.sh b/packages/mosaic/framework/tools/wake/detector.sh index 7bd8abce..36d6fe90 100755 --- a/packages/mosaic/framework/tools/wake/detector.sh +++ b/packages/mosaic/framework/tools/wake/detector.sh @@ -529,6 +529,10 @@ cmd_run() { echo "detector.sh: WARN — off-host liveness beacon emit failed (see beacon.sh); the off-host absence check remains the authoritative dead-man." >&2 fi [ "$once" -eq 1 ] && break + # Close the detector lock fd in the sleep child; otherwise an orphaned sleep + # keeps the single-instance flock (fd 9, taken at exec 9> above) alive after + # the detector parent dies, and no replacement instance can ever acquire it. + # `9>&-` closes ONLY the child's copy — the parent's lock is unaffected. sleep "$interval" 9>&- done }