Bug 1223968 - coreutils uptime wrong on rtc-less system, procps w shows proper time
Summary: coreutils uptime wrong on rtc-less system, procps w shows proper time
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Raymund Will
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-06 13:18 UTC by Ruediger Oertel
Modified: 2024-05-21 03:54 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.