Skip to content

users: add utmp fallback#11579

Open
mattsu2020 wants to merge 1 commit intouutils:mainfrom
mattsu2020:users
Open

users: add utmp fallback#11579
mattsu2020 wants to merge 1 commit intouutils:mainfrom
mattsu2020:users

Conversation

@mattsu2020
Copy link
Copy Markdown
Contributor

@mattsu2020 mattsu2020 commented Apr 1, 2026

Summary

  • Gate all feat_systemd_logind #[cfg] attributes with target_os = "linux" so that non-Linux builds (macOS, FreeBSD, etc.) are unaffected by the libsystemd link requirement
  • Fall back to traditional getutxent() when SystemdUtmpxIter::new() fails at runtime, instead of returning an empty iterator

Context

On Ubuntu 26.04, users prints nothing while GNU users correctly shows logged-in users. Modern systemd no longer populates /var/run/utmp, so utilities that rely on it produce no output. The feat_systemd_logind feature was opt-in, meaning default builds never queried systemd-logind.

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 1, 2026

Is this dynamically linked againsyt libsystemd.so? If so, this should be disabled by default.

@mattsu2020
Copy link
Copy Markdown
Contributor Author

mattsu2020 commented Apr 1, 2026

Is this dynamically linked againsyt libsystemd.so? If so, this should be disabled by default.

Change to fallback only

@mattsu2020 mattsu2020 changed the title feat: enable systemd-logind by default and add utmp fallback users: add utmp fallback Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.

- Gate all feat_systemd_logind #[cfg] attributes with target_os = "linux"
  so that non-Linux builds are unaffected by the libsystemd link requirement
- Fall back to traditional getutxent() when SystemdUtmpxIter::new() fails
  at runtime, instead of returning an empty iterator
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

GNU testsuite comparison:

Note: The gnu test tests/pr/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/tail/pipe-f is now passing!
Skip an intermittent issue tests/cut/bounded-memory (was skipped on 'main', now failing)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants