-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add support for systemd-logind #8483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
06b8e1f to
50c02c5
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
fdbf24d to
7fc6292
Compare
|
GNU testsuite comparison: |
7fc6292 to
b2cb313
Compare
|
GNU testsuite comparison: |
b2cb313 to
9c853b8
Compare
|
GNU testsuite comparison: |
9c853b8 to
a206a94
Compare
|
GNU testsuite comparison: |
a206a94 to
7995bb1
Compare
|
GNU testsuite comparison: |
9e9c61c to
20b4f46
Compare
Add support for systemd-logind for systems where `/var/run/utmp` does not exist any more (e.g. Ubuntu 25.04). Here is some context explaining the switch from utmp to systemd-logind: https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/ Fixes uutils#8376 Signed-off-by: Etienne Cordonnier <[email protected]>
20b4f46 to
b48eac2
Compare
|
GNU testsuite comparison: |
|
I think the PR is good to go (I've undrafted it). Highlighting this comment here, since I had to implement what I consider a GNU coreutils bug to keep uutils-coreutils compatible. On Ubuntu 25.05 "uptime -s" and "who -b" can print a different minute value. I'll try to follow up with GNU coreutils, but I don't know when I will have the time: |
|
There seems to be a bug when using the |
src/uucore/src/lib/features/utmpx.rs
Outdated
| fn new_systemd() -> Self { | ||
| // PoisonErrors can safely be ignored | ||
| let guard = LOCK.lock().unwrap_or_else(|err| err.into_inner()); | ||
| let systemd_iter = systemd_logind::SystemdUtmpxIter::new().ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happen in case of error here ?
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reworked that part to return an empty iterator in case of error, and added comments as well
Sorry about that. I wasn't hitting this bug on my development machine because 25.04 has no utmp any more. Also something is wrong in the CI setup, because "test_boot()" should have catched this. It's working now: |
|
GNU testsuite comparison: |
Co-authored-by: Daniel Hofstetter <[email protected]>
Co-authored-by: Daniel Hofstetter <[email protected]>
getpwuid() is not thread-safe. Signed-off-by: Etienne Cordonnier <[email protected]>
Signed-off-by: Etienne Cordonnier <[email protected]>
Signed-off-by: Etienne Cordonnier <[email protected]>
|
GNU testsuite comparison: |
Signed-off-by: Etienne Cordonnier <[email protected]>
72d97b0 to
d63813a
Compare
|
GNU testsuite comparison: |
|
Maybe something needs to be done about the tests. If running on Ubuntu < 25.04, the tests should use utmp. If running on Ubuntu >= 25.04, the tests should use feat_systemd_logind. This can be automatically detected by using "systemctl --version" which shows whether systemd is compiled with UTMP support or not. This could also be configured manually in the CI files. Right now Please also note that I'm available tomorrow, and then gone for a week. |
Signed-off-by: Etienne Cordonnier <[email protected]>
Signed-off-by: Etienne Cordonnier <[email protected]>
Signed-off-by: Etienne Cordonnier <[email protected]>
Signed-off-by: Etienne Cordonnier <[email protected]>
|
GNU testsuite comparison: |
Signed-off-by: Etienne Cordonnier <[email protected]>
20f4da0 to
16626d4
Compare
|
Commit 20f4da0 is not a change requested in the review, however I think it makes sense: with this change, packagers of distributions based on systemd won't need to change anything in the build process and won't accidentally ship e.g. a broken "who". Edit: I reverted. It will require bigger changes in CI. |
This breaks "Tests/BusyBox test suite" in CI. This reverts commit 16626d4.
|
GNU testsuite comparison: |
Add support for systemd-logind for systems where
/var/run/utmpdoes not exist any more (e.g. Ubuntu 25.04).Here is some context explaining the switch from utmp to systemd-logind:
https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/
For debian/ubuntu, utmp was disabled in systemd build options in version 256.7 (see https://lists.debian.org/debian-user/2024/11/msg00140.html ). For reference this means that utmp is still enabled in Ubuntu 24.10 and gets disabled first with Ubuntu 25.04 (important for the CI tests).
Fixes #8376