diff --git a/Deployment/migrate_data_layout.sh b/Deployment/migrate_data_layout.sh index 3562b67..5dd6e83 100755 --- a/Deployment/migrate_data_layout.sh +++ b/Deployment/migrate_data_layout.sh @@ -99,10 +99,16 @@ say() { printf ' %s\n' "$*"; } step() { printf '\n━━━ %s ━━━\n' "$*"; } # ── Guard: orchestrators mid-run ────────────────────────────────────────────── +# Scoped to THIS installation's path, not to the script names. pgrep is system-wide, and a box +# running both a production checkout and a development clone will always have one of them busy — +# matching on "Orchestrators/" alone made a dev migration abort because prod was mid-cycle, which +# is a process that cannot touch this tree's data at all. The full path is what distinguishes +# them, so that is what is matched. if [[ "$FORCE" == false && "$DRY_RUN" == false ]]; then - running=$(pgrep -fa 'Orchestrators/|Watchdogs/' 2>/dev/null | grep -v "$$" | grep -v migrate_data_layout || true) + running=$(pgrep -fa "$ROOT/(Orchestrators|Watchdogs|Media|Rsync)/" 2>/dev/null \ + | grep -v "$$" | grep -v migrate_data_layout || true) if [[ -n "$running" ]]; then - echo "[ABORT] Orchestrator or watchdog is running — it may rewrite state mid-move:" >&2 + echo "[ABORT] A job from this installation is running — it may rewrite state mid-move:" >&2 echo "$running" >&2 echo "Wait for it to finish, or re-run with --force if you are sure." >&2 exit 1