Start the daemon on Ubuntu GNOME login - #277
Merged
Merged
Conversation
On Ubuntu 26.04 / GNOME 50, systemd evaluated voisu.service's ConditionEnvironment=|WAYLAND_DISPLAY / |DISPLAY before gnome-shell had imported them into the user manager, skipped the unit, and never retried, so the daemon was dead after every login. The daemon unit no longer carries a start condition. Under --systemd the daemon waits up to 20 s for a display variable in the user manager environment: when one arrives it exits 75 so Restart=on-failure respawns it with the manager's current environment; if none arrives it exits 78, which RestartPreventExitStatus turns into a failed unit instead of a restart loop. Both units also order after graphical-session.target. The README gains an Ubuntu GNOME troubleshooting section covering the expected doctor SKIP/WARN rows, the Shell-extension Overlay, clipboard paste fallback, and resetting the RemoteDesktop restore token.
The --systemd display wait made this test depend on the host having WAYLAND_DISPLAY; on CI it waited 20 s and exited 78.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Ubuntu 26.04 / GNOME 50 (voisu 0.63.0 deb),
voisu.servicewas dead after every login:systemd checked the unit's display conditions before gnome-shell had imported
WAYLAND_DISPLAY/DISPLAYinto the user manager. It never retries a skipped condition, so the unit stayed dead until a manualsystemctl --user start.Result
ConditionEnvironment. Under--systemdthe daemon waits for the display itself, with a real 20 s deadline that includes query time.WAYLAND_DISPLAY/DISPLAYappears in the user manager environment, it exits 75 andRestart=on-failurerespawns it with that environment.RestartPreventExitStatus=78then leaves a failed unit instead of a restart loop, andvoisu doctorpoints at the journal.voisu service install, orderAfter=graphical-session.target. This does not cycle withWantedBy=it. The earlier recorded cycle came fromAfter=xdg-desktop-portal.service, and that is still forbidden.ConditionEnvironment=WAYLAND_DISPLAY. On GNOME the Overlay is the Shell extension, so that unit is unused there.Focus guardWARN are expected.Not in this PR: the "autopaste lands nothing" report. On GNOME, Direct Delivery submits Ctrl+V through libei unless the seat offers text input, so a terminal that pastes with Ctrl+Shift+V gets nothing. That is the leading hypothesis, but it is unconfirmed without a clean retest on the reporter's machine, so this PR documents it rather than changing Delivery.
Verification
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked: all exit 0.system::display_waitunit tests use a fake clock and cover:tests/daemon_display_wait.rsdrives the real binary through a fakesystemctl.systemctl --user set-environmentin between.voisu-daemon --systemdran as a transient unit with the packaged sandbox properties and without display variables. It reached the user manager, logged the arrival line, and exited 75.systemd-analyze --user verifypasses for both units.