Bug 1223968

Summary: coreutils uptime wrong on rtc-less system, procps w shows proper time
Product: [openSUSE] openSUSE Tumbleweed Reporter: Ruediger Oertel <ro>
Component: BasesystemAssignee: Raymund Will <rw>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: kukuk
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ruediger Oertel 2024-05-06 13:18:27 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
Comment 1 Thorsten Kukuk 2024-05-06 14:19:45 UTC
(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.