-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Description
In a libsystemd of version 254 three functions were added (https://manpages.debian.org/experimental/libsystemd-dev/sd_session_get_display.3.en.html#HISTORY):
- sd_session_get_username()
- sd_session_get_start_time()
- sd_session_get_leader()
First 2 can be used to simplify current funcs, but the last one allows us to close get a session leader PID which previously was not available
You can check by running (on a systemd machine)
$ cargo run -q --all-features -- who -Ha
NAME LINE TIME IDLE PID COMMENT EXIT
system boot 2025-10-25 15:10
root - pts/23 2025-10-27 18:17 22:58 0
root - pts/11 2025-10-27 17:55 old 0
alexander ? seat0 2025-10-25 15:24 ? 0 (:0)
alexander - tty2 2025-10-25 15:24 old 0 (:0)
$ who -Ha
NAME LINE TIME IDLE PID COMMENT EXIT
system boot 2025-10-25 15:10
root - pts/23 2025-10-27 18:17 22:57 164244
root - pts/11 2025-10-27 17:55 old 162288
alexander ? seat0 2025-10-25 15:24 ? 2456 (:0)
alexander - tty2 2025-10-25 15:24 old 2456 (:0)
My only concern is version compatibility
I already implemented the correct behaivor but I need you opinion on this