Closed vincentdephily closed 3 months ago
Nice bug :)
What's the output of uptime --version
? My guess is you are using uptime
from procps-ng
, not from GNU. At least on my machine with Arch Linux it doesn't use the GNU version and I see a similar difference in the number of users. However, when I use the GNU version I get the same output as with uutils.
Ah, good catch, I'm using uptime from procps-ng 4.0.4
, not GNU uptime
. My distro doesn't seem to package GNU uptime, but building that from git I get the same behavior between uutils and GNU.
Closing as invalid, sorry for the noise.
Uutils finds more users than GNU, on a Linux (Gentoo) Systemd KDE single-user desktop:
Looking at strace, GNU seems to get the info from
/run/systemd/sessions
(despite/run/systemd/sessions/10
starting withThis is private data. Do not parse.
), while uutils opens/var/run/utmp
.FWIW, I added some debug in
src/uu/uptime/src/platform/unix.rs
to get thepid/user/is_user_process
and I get (with "work" being my username on this system):Using git main branch, 92c3de538755d69b7fa3d79030ca5dff44445809