When i go into hibernation and resume then look at the result of running uptime , i note that the the hibernation duration is also included.
in pm-hibernate man pages. it states that: "During hibernate the system is fully powered off," .
shouldn't uptime be resetting to zero if the 'the system is fully powered off' or pausing because the system is hibernated hibernated, or is this a bug?
Asked
Active
Viewed 2,390 times
8
danleyb2
- 183
-
Uptime is measured from the time of boot - the OS isn't really booted during the time when you resume from hibernation - it's a restoration of a state, saved on the hard drive (where suspend is stored in RAM). So, uptime's not the best metric for determining the overall time the system has been on but, rather, is a metric to tell when the last reboot was. – KGIII Oct 25 '15 at 19:55
1 Answers
5
shouldn't uptime be resetting to zero if the 'the system is fully powered off'
- suspend/hibernate are not considered "off". The last "wake up time" is stored in
/var/log/pm-suspend.log.
or pausing because the system is hibernated
- now that would be odd. How would one then know what the actual uptime is?
or is this a bug?
Uptime is the time since last (re)boot. Basically the system stores at boot time what the time is and "now" -/- that time is the uptime. So in that regard: no, not a bug. The command predates notebooks and hibernate/suspend so maybe if you create a feature request someone decides it is a good feature to have. It probably is a very easy addition:just update the time stored on disk. And I can not imagine it is a lot more than adding a call to the hibernation/suspend script. But it will also be difficult to get it happen :)
Rinzwind
- 310,127
-
Logically it would make most sense for it to not include time during hibernation. It's called "uptime", not "time since boot". Additionally, including the time in hibernation implies that the system was running during that time, which it was not. I personally would go as far as calling it a bug. The name "uptime" doesn't leave any room for interpretation. Including time the system was not "up" isn't just misleading design, it's incorrect. – Prime624 Feb 06 '25 at 20:24