Repository navigation
server: Wait briefly for the login helper socket - #615
Merged
bilelmoussaoui merged 1 commit intoOct 24, 2026
Merged
bilelmoussaoui merged 1 commit into
bilelmoussaoui merged 1 commit into
Conversation
📊 Code Coverage Report
Coverage report generated by cargo-tarpaulin |
pam_oo7's auto_start fallback forks oo7-daemon-login from the same PAM session stack whose pam_systemd.so starts oo7-daemon.service, so the daemon can try to connect to oo7-daemon-login.sock before the helper has bound it. read_secret_from_login_helper() made a single connect attempt and returned None on failure. The login secret was then dropped, the login collection stayed locked for the whole session, and nothing was logged on either side. On a greetd login the daemon's connect landed about 37 ms before the helper bound its socket. Retry the connect every 10 ms for up to 500 ms. On the login path the helper shows up within tens of milliseconds. When no helper is coming, such as a manual restart of the service, startup is 500 ms slower. Assisted-by: Claude Opus 5.5
kitten-lily
force-pushed
the
fix/login-helper-connect-retry
branch
from
October 24, 2026 18:22
626ed0a to
7257cdf
Compare
This was referenced Oct 24, 2026
Collaborator
|
thanks |
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.
On a fresh-boot login through greetd, the login collection sometimes stays locked for the whole session, even though
pam_oo7reports that it sent the secret.pam_oo7.so auto_startruns one module afterpam_systemd.so, andpam_systemd.sois what getsoo7-daemon.servicestarted. Whenpam_oo7finds no daemon socket yet, it forksoo7-daemon-login, which bindsoo7-daemon-login.sockand waits up to 120 s for the daemon to collect the secret. The daemon reads that socket once, inread_secret_from_login_helper(), beforeService::run. If the connect fails, it returnsNonewithout logging anything. On my machine the daemon's connect landed about 37 ms before the helper had bound the socket. The secret was dropped and no error appeared on either side.This PR replaces the single connect with a retry every 10 ms for up to 500 ms. On the login path the helper appears within tens of milliseconds. When no helper is coming, such as a manual
systemctl --user restart oo7-daemon, startup takes 500 ms longer.Testing
connect_to_login_helper:cargo test --manifest-path ./server/Cargo.tomlpasses (107 tests), as docargo clippy --workspace --all-targets -- -D warningsandcargo +nightly fmt --all --check. I didn't run theopenssl_cryptovariant because this machine has no OpenSSL headers. The change doesn't touch crypto.I wrote this with AI assistance (Claude Opus 5.5) and reviewed and tested it before opening the PR.