From 46239012b48eec8b5b890ac22a4d18e9c038285e Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 22 Aug 2026 00:24:06 -0400 Subject: [PATCH] The dry-run cleanup trap replaced the lock-release trap and orphaned fallback.lock --- Fallback/fallback.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Fallback/fallback.sh b/Fallback/fallback.sh index 98ef2a0..44b81b1 100755 --- a/Fallback/fallback.sh +++ b/Fallback/fallback.sh @@ -936,8 +936,12 @@ dryrun_state_cleanup() { [[ "$DRY_RUN" == true && "$FALLBACK_STATE_FILE" == *".dryrun."* ]] && rm -f "$FALLBACK_STATE_FILE" return 0 } -trap 'dryrun_state_cleanup' EXIT -trap 'FALLBACK_RUNNING=false; warn "Fallback received shutdown signal — stopping cleanly"; dryrun_state_cleanup; exit 0' \ +# Must call _release_all_locks too. acquire_lock() registers its own EXIT trap, and bash keeps +# exactly one per signal — a bare `trap ... EXIT` here silently replaced it and orphaned +# fallback.lock, which is the precise failure the _LOCK_FILES registry in common.sh was built to +# stop. The signal trap only needs `exit 0`; that fires EXIT, which does both jobs. +trap 'dryrun_state_cleanup; _release_all_locks' EXIT +trap 'FALLBACK_RUNNING=false; warn "Fallback received shutdown signal — stopping cleanly"; exit 0' \ SIGTERM SIGINT while [[ "$FALLBACK_RUNNING" == true ]]; do