From 9ec7916c0b7087fe9ebd6a14934498453269b0ee Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 26 Jul 2026 14:07:41 -0700 Subject: [PATCH] Keep the inhibit-delay check alive when there is nothing to check Migrations run under bash -euo pipefail, where an assignment from a failed command substitution ends the script. Reading InhibitDelayMaxSec out of a drop-in that is not there exits sed 2, so the migration died at exactly the condition it was written to detect: instead of flagging reboot-required, it aborted before reaching the flag. The busctl read had the same shape, with pipefail standing in for the failed substitution. An aborted migration is never marked complete and takes omarchy-migrate's own -e down with it, so the two migrations queued behind this one stopped running as well. Co-Authored-By: Claude Opus 5 (1M context) --- migrations/1784970000.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migrations/1784970000.sh b/migrations/1784970000.sh index af5c3001..e01509e5 100644 --- a/migrations/1784970000.sh +++ b/migrations/1784970000.sh @@ -12,10 +12,13 @@ sudo systemctl reload systemd-logind >/dev/null 2>&1 || true # the old five second window in place. omarchy-system-sleep-lock reads this same # property at runtime, so it stays correct either way -- the reboot flag is only # about getting the wider window to take effect. +# +# Both reads have to survive failing: a missing drop-in or an unreachable logind +# is the very condition being tested for, and migrations run under -e. dropin=/etc/systemd/logind.conf.d/20-inhibit-delay.conf -expected_s=$(sed -n 's/^InhibitDelayMaxSec=//p' "$dropin" 2>/dev/null) +expected_s=$(sed -n 's/^InhibitDelayMaxSec=//p' "$dropin" 2>/dev/null || true) effective_us=$(busctl get-property org.freedesktop.login1 /org/freedesktop/login1 \ - org.freedesktop.login1.Manager InhibitDelayMaxUSec 2>/dev/null | awk '{print $2}') + org.freedesktop.login1.Manager InhibitDelayMaxUSec 2>/dev/null | awk '{print $2}' || true) if [[ -z $expected_s || $effective_us != $((expected_s * 1000000)) ]]; then omarchy-state set reboot-required