From 9be2952ff8260a2ea99c62ffbba009939dfed27c Mon Sep 17 00:00:00 2001 From: Kit OC5 Date: Wed, 23 Sep 2026 14:22:59 -0400 Subject: [PATCH] rerun_ci: detect a running oneshot sync correctly (is-active lies for oneshot) Co-Authored-By: Claude Opus 5.5 --- scripts/rerun_ci.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/rerun_ci.sh b/scripts/rerun_ci.sh index fc95a47..4d4f21b 100755 --- a/scripts/rerun_ci.sh +++ b/scripts/rerun_ci.sh @@ -22,7 +22,11 @@ head=$($G rev-parse "refs/heads/${branch}") [[ "$head" == "$want"* ]] || { echo "refusing: ${branch} is at ${head:0:7}, not ${want}"; exit 1; } parent=$($G rev-parse "${head}^") -while systemctl is-active -q windygit-sync; do sleep 5; done +# NOT `systemctl is-active`: the sync is Type=oneshot, which reads "activating" +# (exit 3) for its whole run, so is-active says "idle" mid-run. +busy() { case "$(systemctl show windygit-sync -p ActiveState --value)" in + activating|active|deactivating|reloading) return 0;; esac; return 1; } +while busy; do sleep 5; done $G update-ref "refs/heads/${branch}" "$parent" "$head" mark=$(awk '{print int($1*1000000)}' /proc/uptime) echo "rewound ${repo}:${branch} ${head:0:7} -> ${parent:0:7}"