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