Skip to content

Ensure GDM sees managed users after reboot - #1744

Draft
adombeck wants to merge 4 commits into
mainfrom
1743-gdm-sometimes-does-not-display
Draft

Ensure GDM sees managed users after reboot#1744
adombeck wants to merge 4 commits into
mainfrom
1743-gdm-sometimes-does-not-display

Conversation

@adombeck

Copy link
Copy Markdown
Contributor

AccountsService can enumerate NSS users before authd has completed its socket-activated startup, leaving the GDM user cache without managed accounts until they log in once. Start authd as part of the NSS lookup target and make that target wait for the daemon to become ready.

Also adds an e2e-test to test that the authd user shows up in GDM after a reboot.

Closes #1743
UDENG-11043

@adombeck adombeck added the e2e-tests This issue is related to end-to-end tests / Run end-to-end tests on this pull request label Jul 18, 2026
adombeck and others added 3 commits July 19, 2026 15:53
I've encountered the case that an authd user that logged in on the
system before was not listed in GDM after a reboot. Add an e2e-test
which tests that.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AccountsService can enumerate NSS users before authd has completed its
socket-activated startup, leaving the GDM user cache without managed
accounts until they log in once. Start authd as part of the NSS lookup
target and make that target wait for the daemon to become ready.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A failed or metadata-only-deleted live snapshot leaves its deterministic disk
filename behind. Subsequent provisioning then cannot recreate the snapshot.
Use a unique external disk and memory filename for each live snapshot instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adombeck
adombeck force-pushed the 1743-gdm-sometimes-does-not-display branch from 5b917a6 to c641763 Compare July 19, 2026 14:17
@adombeck

Copy link
Copy Markdown
Contributor Author

I verified that the new e2e-test fails without the Ensure GDM sees managed users after reboot commit and passes with that change

@adombeck
adombeck marked this pull request as ready for review July 20, 2026 15:16
@adombeck
adombeck marked this pull request as draft July 20, 2026 15:17
@adombeck
adombeck requested a review from Copilot July 20, 2026 15:17
@adombeck

Copy link
Copy Markdown
Contributor Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a boot-time ordering issue where GDM/AccountsService can enumerate NSS users before the socket-activated authd daemon is fully started, causing managed users to be missing from the GDM user list until they log in once. It updates the systemd unit relationships to start authd earlier and adds an e2e test to ensure managed users appear in GDM after a reboot.

Changes:

  • Adjust systemd unit dependencies/ordering so authd is started ahead of nss-user-lookup.target (which AccountsService uses as an ordering point).
  • Add an e2e Robot Framework test covering “managed user listed by GDM after reboot”.
  • Make VM snapshot creation more collision-resistant by using unique external snapshot disk/memory filenames.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
e2e-tests/vm/lib/libprovision.sh Avoid snapshot file collisions by generating unique external snapshot filenames.
e2e-tests/tests/gdm_managed_user_after_reboot.robot New e2e regression test validating GDM lists an existing managed user after reboot.
debian/authd.socket Ensure authd.service is pulled in early (with the socket) before NSS lookup target is reached.
debian/authd.service.in Order authd.service before nss-user-lookup.target so the target waits for readiness (Type=notify).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +26 to +27
Wait Until Keyword Succeeds 3 min 1 sec
... SSH.Execute systemctl is-system-running --wait

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot ok, but then extract a keyword for this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e6cd694.

I extracted the reboot readiness wait into a shared Robot keyword (Wait Until System Is Running Or Degraded) in e2e-tests/resources/utils.resource, and updated gdm_managed_user_after_reboot.robot to use it.

Comment on lines +23 to +24
${display_name} = SSH.Execute getent passwd ${username} | cut -d: -f5 | cut -d, -f1

Comment thread debian/authd.service.in
Comment on lines +6 to +7
# AccountsService starts after this target to populate the GDM user list.
Before=nss-user-lookup.target

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is needed if the service needs the socket that should be before the lookup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-tests This issue is related to end-to-end tests / Run end-to-end tests on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GDM sometimes does not display authd users after reboot

4 participants