OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
power-suspend low very-common DISPUTE

Recognise the omarchy-sleep-lock.service FAILURE logged around each suspend as a self-healing restart race

omarchylaptopsystemd
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy omarchy 4.0.4-1 on 2026-10-05
AUDIT NOTE

Read #7280 with all comments, #13160 with its comment, #13701, and #8112. The race, the one-failure-then-recovery pattern, the 31 failures across 132 transitions with zero report_unsecured lines (#13701), and the shipped Restart=always RestartSec=2 (confirmed on this workstation, StartLimitBurst=5, StartLimitIntervalUSec=10s) all hold. Three things were wrong or missing. (1) The title calls it harmless, but #7280 shows the collision also happens on the way down, during suspend preparation, and #8112 shows a fast second suspend can beat the respawn and proceed with no Omarchy delay inhibitor. Self-healing is accurate. Harmless is not. (2) The record misses the variant two #7280 commenters measured: when logind's sleep operation never finishes (a suspend wedged in the kernel, PreparingForSleep stays b true), every restart fails, 662 in 25 minutes and 3267 in two hours, and no inhibitor is held for the rest of the session. A reader with that log would be told it is harmless. (3) The start-limit-hit branch: two commenters showed by measurement that the restart path cannot trip the limiter at RestartSec=2 because systemd spaces restarts about 2.25 s apart, so six starts never fit in 10 s. It can only happen from manual or target-triggered starts. The reset-failed commands are still correct, so they were kept with that framing. The advice not to raise RestartSec is supported: commenters found 4 s and 10 s did not prevent the collision and a longer delay widens the uninhibited window. Nothing was exercised on a suspend here, because this workstation's session must not be suspended.

The cause above was rewritten on 2026-10-05 to match this note; the fix was corrected by the audit itself.

Symptom

Every suspend or resume leaves this in journalctl --user -u omarchy-sleep-lock.service:


systemd-inhibit[42152]: Failed to inhibit: The operation inhibition has been requested for is already running
omarchy-sleep-lock.service: Main process exited, code=exited, status=1/FAILURE
omarchy-sleep-lock.service: Failed with result 'exit-code'.
omarchy-sleep-lock.service: Scheduled restart job, restart counter is at 8.
Started Lock Omarchy before suspend.

It looks like the lock-before-suspend service is broken.

Cause

omarchy-system-sleep-monitor handles exactly one PrepareForSleep event and then exits, releasing its delay inhibitor as soon as the lock is secure. The unit relies on Restart=always with RestartSec=2 to come back. That restart can land while logind's sleep operation is still in flight, on resume or during suspend preparation, and logind refuses a new Inhibit() call during an active sleep operation, so systemd-inhibit exits 1. The next restart about 2 seconds later normally succeeds. The lock was already secure before the suspend. One reporter counted 31 failures across 132 sleep transitions with zero unlocked suspends. The real cost is a window of about 2 seconds, sometimes several failed restarts on a slow resume, in which no Omarchy delay inhibitor is held, so a second suspend inside it is not delayed for the lock. If the sleep operation never finishes, because a suspend wedged in the kernel, every restart fails and the unit loops for the rest of the session with no inhibitor at all. Measured by two reporters, the shipped restart spacing of about 2.25 s keeps the unit below the default start limit, so the restart path loops rather than landing in failed. Open upstream as #7280, #8112, #13160 and #13701, unchanged on 4.0.4-1.

Fix

Nothing needs repairing when each failure is followed by a successful start. Check that the unit recovered and that no suspend went through unlocked:


systemctl --user is-active omarchy-sleep-lock.service        # active
systemd-inhibit --list --what=sleep | grep Omarchy           # Lock screen before suspend
journalctl --user -u omarchy-sleep-lock.service -b | grep -c 'Failed to inhibit'
journalctl --user -u omarchy-sleep-lock.service -b | grep 'suspending without a secure lock'

A few Failed to inhibit lines per sleep transition, each run ending in a successful start, is this behaviour. A suspending without a secure lock line is a different problem. See the corpus records stalled-lock-latch-suspends-unlocked and omarchy-sleep-lock-4000ms-budget-logind-not-reloaded.

**If the failures never stop**, with the restart counter climbing every 2 seconds long after resume, logind is stuck in a sleep operation rather than racing one:


busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager PreparingForSleep
systemctl status systemd-suspend.service

b true long after resume, or systemd-suspend.service stuck in activating, means a suspend wedged below Omarchy. The pre-suspend lock is disarmed for the rest of the session. Save your work and reboot, then look for the kernel or driver error around the wedged suspend with journalctl -k -b -1.

If the unit ever shows failed with start-limit-hit, which the restart path alone does not reach but repeated manual starts can, clear it:


systemctl --user reset-failed omarchy-sleep-lock.service
systemctl --user start omarchy-sleep-lock.service

Do not disable or mask the unit, and do not raise RestartSec to quiet the log. Reporters found 4 and 10 seconds did not stop the collision, and a longer delay widens the window with no inhibitor.

Verify

systemctl --user is-active omarchy-sleep-lock.service prints active a few seconds after resume, and the Omarchy entry is back in systemd-inhibit --list --what=sleep.

Sources

omarchy-sleep-lock-service-failed-every-resume