Repository navigation
utmpx: fall back to systemd-logind on Linux when traditional utmp is empty/unavailable - #11579
mattsu2020 wants to merge 1 commit into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Change to fallback only |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Merging this PR will degrade performance by 5.46%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | three_39_bit_primes |
583.2 ms | 617.8 ms | -5.6% |
| ❌ | Simulation | five_38_bit_primes |
1.6 s | 1.7 s | -5.33% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mattsu2020:users (aa176f3) with main (6292c03)
Footnotes
-
54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
Is there any way to achieve full feature without runtime strong |
|
Or can we believe soname compatibility of systemd and publish them? |
Since I changed it to dynamic load, I'll test to see if this works. |
|
And remove |
|
It seems pure Rust solution is possible: https://github.com/lucab/zbus_systemd (thought maintainer might not want to add such dep...) |
|
nice, ok |
|
Code changes are mostly complete |
|
An additional reason that we want to have this PR: #13212 |
See #8376 (comment) where I explained why I did not use zbus in the implementation of systemd-logind. It is a huge crate. |
|
Will it still be compatible with GNU coreutils behavior? how much is it deviating? the goal of the initial implementation of systemd-logind was to have the same behavior than GNU coreutils. |
|
@Ecordonnier How about using |
Mostly, but not completely. The systemd-derived records are intended to match GNU coreutils, including boot records and separate seat/TTY entries. However, there are still some known differences, such as session PID handling, remote user formatting, and TTY fallback behavior. |
Using zbus would grow the binaries by 800KB. I don't think we want this. |
|
I think it is worth to inc multicall-binary 800KiB for simplicity and consistency of binaries published at here. |
|
@Ecordonnier Are you fine to merge this? |
This comment was marked as resolved.
This comment was marked as resolved.
On Linux, try systemd-logind when the default utmp file is missing or empty. Load libsystemd at runtime so systems without it can still use traditional utmp, and remove the opt-in feature. Read the boot time from /proc/stat instead of the random-seed timestamp.
On Linux systems with a missing or empty default utmp file, login records can be unavailable to users, who, pinky, and uptime. Try systemd-logind in that case, loading libsystemd at runtime and falling back to traditional utmp if it is unavailable. This replaces the opt-in feature.
Read the boot time from /proc/stat instead of the systemd random-seed timestamp.
Related to #3219.