Bugzilla – Bug 1223968
coreutils uptime wrong on rtc-less system, procps w shows proper time
Last modified: 2024-05-21 03:54:44 UTC
on a raspberry (and probably other platforms without a RTC), uptime does not report what /proc/uptime would deliver but tries to find it out via utmp boot_time but that fails (as that is synthesized via build date of the initrd or similar). on the other hand, "w" from procps nicely prints the proper uptime of the system ro@pi4l:~> uptime 14:58:33 up 33 days 5:54, 0 users, load average: 0,06, 0,13, 0,17 ro@pi4l:~> w 14:59:13 up 3 days, 13:56, 0 users, load average: 0,03, 0,11, 0,16 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
(In reply to Ruediger Oertel from comment #0) > on a raspberry (and probably other platforms without a RTC), uptime > does not report what /proc/uptime would deliver but tries to find it > out via utmp boot_time but that fails (as that is synthesized via build > date of the initrd or similar). coreutils developer don't trust the kernel, since you can pause a VM from outside and the kernel would not notice it or something similar. They use the timestamp of I think random-seed or something similar. I meanwhile think we should replace uptime from coreutils with the one from procps-ng.