Keep shutdown worker on the same script path

This commit is contained in:
Chemineer committed 2026-09-27 09:25:39 -05:00
1 parent eaaca77efb
commit bedc2a3979
2 files changed
+10 -1

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ elif [[ ${1:-} == "--inhibit" ]]; then
# Block lid handling explicitly: it ignores high-level sleep inhibitors.
systemd-inhibit --what=sleep:idle:handle-lid-switch \
--who=Omarchy --why="Shutdown in progress" --mode=block \
"$OMARCHY_PATH/bin/omarchy-system-shutdown" --inhibited || {
"$0" --inhibited || {
status=$?
omarchy-notification-send -u critical "Shutdown failed" "Could not complete shutdown. Please try again."
exit "$status"
+9
View File
@@ -107,6 +107,15 @@ grep -q '^systemctl poweroff --no-wall$' "$CALL_LOG" || fail "poweroff runs afte
! grep -q '^omarchy-notification-send ' "$CALL_LOG" || fail "successful shutdown sends no failure notification"
pass "shutdown stays inhibited through preparation and the poweroff request"
: >"$call_log"
rm -f "$CALL_LOG.grace" "$CALL_LOG.poweroff"
# Dev link/unlink can leave the user manager pointing at a removed checkout.
OMARCHY_PATH="$test_tmp/removed-checkout" bash "$CALL_LOG.worker" || fail "shutdown uses its own script when the service environment is stale"
[[ -f $CALL_LOG.poweroff ]] || fail "shutdown reaches poweroff with a stale service environment"
[[ ! -f $CALL_LOG.inhibited ]] || fail "shutdown releases inhibition with a stale service environment"
! grep -q '^omarchy-notification-send ' "$CALL_LOG" || fail "stale service environment sends no failure notification"
pass "shutdown uses its own script when the service environment is stale"
: >"$call_log"
rm -f "$CALL_LOG.grace" "$CALL_LOG.poweroff"
BLOCK_WINDOW_CLOSE=true bash "$CALL_LOG.worker" || fail "shutdown proceeds while window closing is blocked"