diff --git a/testbox/scripts/auto-pull-restart.sh b/testbox/scripts/auto-pull-restart.sh index 5cdaffb..dec845d 100755 --- a/testbox/scripts/auto-pull-restart.sh +++ b/testbox/scripts/auto-pull-restart.sh @@ -240,9 +240,11 @@ run_once() { local java_before java_after local services_line + exec 9>&- 2>/dev/null || true exec 9>"$LOCK_FILE" if ! flock -n 9; then log "deploy lock busy; skip this tick" + exec 9>&- return 0 fi @@ -301,6 +303,9 @@ run_once() { rc=$? [ "$rc" -eq 10 ] || log "admin update skipped due to error rc=$rc" fi + + flock -u 9 + exec 9>&- } usage() {