Repository navigation
Fall back when reboot has no session D-Bus - #11151
caueguerra wants to merge 8 commits into
Conversation
omarchy-system-reboot and shutdown always used systemd-run --user, which fails from tmux, SSH, or a bare TTY when the session bus variables are unset. Reconstruct the bus from XDG_RUNTIME_DIR when possible, then fall back to the system manager so the delayed reboot still schedules.
|
Reviewed at 901d9aa against What ran on the worker:
Reviewed by Claude Opus 5.5. The second opinion (Codex Medium) did not run: today's review budget was spent. So this is verified but not marked ready, and it waits on that second review and on the maintainer. #13984 rewrites the same two scripts and still calls |
…hutdown quattro now schedules shutdown as a bounded user service that holds a sleep and lid inhibitor, so the fallback moves with it: restore the session bus from XDG_RUNTIME_DIR, and when the user manager is still unreachable start the same service in the system manager.
The reconstruction tests only required a non-empty address, and nothing exercised a missing XDG_RUNTIME_DIR. The systemd-run mock now records what the user manager attempt saw, so both restorations are checked by value.
[Medium impact] The change affects how system power requests are scheduled. The PR should not merge until the fallback keeps desktop preparation under the caller’s account. Findings
SummaryRestores missing session-bus settings before scheduling a power action.
|
| systemd-run --system --collect --quiet --property=Type=exec --property=RuntimeMaxSec=30s \ | ||
| "$OMARCHY_PATH/bin/omarchy-system-shutdown" --inhibit |
There was a problem hiding this comment.
Shutdown skips closing applications
If the system-manager fallback is authorized while applications are open, the --inhibit worker runs as root without the caller’s desktop environment. omarchy-hyprland-window-close-all cannot reach the user’s Hyprland session, and omarchy-state targets root’s state instead of the user’s. The worker still powers off after two seconds, skipping the promised clean application shutdown.
Keep desktop preparation in the user’s session and move only the privileged power-off step to the system manager.
Sandboxes that deny binding a Unix socket would otherwise fail the test on a missing fixture rather than a product bug, as compositor-guard-test.sh already allows for. The XDG_RUNTIME_DIR case needs no socket, so it runs first.
|
This branch no longer merged with What changed in the merge:
What ran, on a worker built from the Omarchy ISO, against
When the fallback runs as root, it doesn't close the user's windows or clear their restart state. Codex and Greptile both flagged this. It only happens when there is no user manager to reach, which in practice means root through Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion over three rounds. Codex withdrew its first-round finding (the root fallback above) after checking that reasoning, and it agreed with the test changes. Its last round on this head found nothing open; independence between the two reviews is not guaranteed. This now waits on the maintainer. #14248 and #13984 rewrite the same scripts and still call |
quattro replaced omarchy-system-reboot and omarchy-system-shutdown with a single omarchy-system that still schedules every session exit with an unconditional systemd-run --user. The fallback moves there: restore XDG_RUNTIME_DIR and the session bus first, and when the user manager still cannot be reached, start the same bounded --execute service in the system manager for reboot and shutdown. Logout stays user-manager only, since uwsm stop run by the system manager cannot end the caller's session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch stopped merging with What changed in the merge:
What ran, on a worker built from the Omarchy ISO, against
Greptile's finding is the same one answered above: when the fallback runs as root, preparation doesn't reach the user's Hyprland session. That only happens when no user manager can be reached, and the fallback still powers off where Reviewed by Claude Opus 5.5. Codex Medium reviewed this head as the second opinion. It found nothing open, agreed with the logout decision and reproduced the failure on |
|
Still a real gap for update→reboot from tmux/SSH (#11108).
|
quattro added a reboot-boot-menu action to omarchy-system and appended its test to system-power-test.sh. The script merged cleanly, and the new action takes the system-manager fallback like reboot, since it is not logout. The test conflicted at the end of the file: quattro's block runs first now, because this branch's tests end in an early exit where a Unix socket cannot be bound, and reboot-boot-menu joins the fallback loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch stopped merging with What changed in the merge:
What ran, on a worker built from the Omarchy ISO, against
Reviewed by Claude Opus 5.5. Codex Medium reviewed the merge as the second opinion and found nothing open: it checked that no later test depends on the moved block and that |
quattro removed reboot-boot-menu from omarchy-system and its test (omacom#15795), so the block this branch had moved ahead of its own tests goes too, and the fallback loop covers reboot and shutdown only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch stopped merging with What changed in the merge:
What ran, on a worker built from the Omarchy ISO, against
Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion over two rounds. Codex found that when the fallback runs as root, |
Carry the session-bus restore and system-manager fallback through omacom#19003, which added the firmware action, and omacom#19006, which delays the exit OSD. Firmware falls back like reboot and shutdown, so the comment now names every exit but logout, and the fallback test covers it. Quattro's firmware test runs before this branch's tests, the last of which exits early where a Unix socket can't be bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch stopped merging with What changed in the merge:
What ran, on a worker built from the Omarchy ISO, against
Reviewed by Claude Opus 5.5. Codex Medium and muse-wonder (via pi, thinking high) reviewed the merge as second opinions and found nothing to change. They checked that no later test depends on what the moved firmware block leaves behind. They also checked that the logind firmware check and One question is still open, as before. When the fallback runs as root in the system manager, closing windows and saving state don't reach the user's Hyprland session. So the choice between keeping that fallback and shipping only the session-bus restore is the maintainer's. This now waits on the maintainer. |
omarchy update→ reboot fails from tmux, SSH, or a bare TTY with:omarchy-system-reboot(and shutdown) always calledsystemd-run --user. Restore the session bus from$XDG_RUNTIME_DIR/buswhen that socket exists, and fall back tosystemd-run --systemwhen it does not, so the 2s delayed reboot still schedules before windows close.Fixes #11108