On Fri, 4 Oct 2024 15:11:58 +0200, Thorsten Kukuk via openSUSE Factory <factory@lists.opensuse.org> wrote:
Hello,
There are current two "uptime" implementations with different behavior:
1. coreutils The GNUlib developers are of the opinion, that /proc/uptime is not correct, as the kernel does not count the time as uptime, in which a VM is stopped. I have no idea if the time where a VM is stopped should be really counted as uptime, I would say no. The problem with their implementation is, that we have several bug reports, that the uptime is wrong. Reason is, that they try to determine the boot time via timestamps from files, and if the machine has no RTC this time is most likely wrong. In other cases, the time does not get updated or the tools counts soft-reboots as real reboots. Feedback from last weeks All Systems Go! conference is, that they see the coreutils uptime behavior as bug.
2. procps-ng It's using /proc/uptime, which means it reports the uptime as the kernel sees it.
Due to the problems with 1), shouldn't we switch to 2)?
As an end-user, *I* would expect uptime to report the duration since boot, whether the machine was available or not. IOW the time since the kernel started. I acknowledge that actual uptime (the time the machine was available and not sleeping) has value and now that I am aware I could imagine I want to see that too.
Thorsten
-- H.Merijn Brand https://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.37 porting perl5 on HP-UX, AIX, and Linux https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org