7

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?

1
  • 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, 2015 at 19:55

1 Answer 1

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 :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .