SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Rep:
Uptime shows incorrectly when using hibernate
I have a server which goes into hibernate overnight when I have no need to use it. I use WOL from my laptop which brings it back up next time I need it.
However, the uptime shows that it has been running currently for 145 days and a few hours, which it can't have been as it's been hibernating.
Anyone got any suggestions as to how I can get the uptime to read correctly?
More of a learning exercise really, so no immediate rush.
Maybe not entirely technically correct, but here's my understanding: as for as your machine is concerned, it *has* been up that entire time - suspend/hibernate are not considered "off" in that regard.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
Yeah, that is my understanding to. So 'uptime' is not really a fair representation of either the computer activity or indeed an accurate description of itself. More a 'time on power' than an uptime.
Do you know off any utility that will show correctly then the amount of time actually being used as opposed to just being connected to power, a 'serving time' if you will?
This could probably be setup in your system by creating a bash script that logs when the machine is turned on, and when sleep, or hibernate are activated, and log it all to give you the correct up time.
Obviously this would be something you would have to build, but I probably wouldn't be very difficult.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
Quote:
Originally Posted by syg00
Don't be so presumptuous - uptime predated laptops, let alone Linux support of hibernate/suspend.
Uptime is a measurement of the time a machine, i.e. computer is available and working. Therefore the very act of placing one into a hibernated state renders it unavailable until it is re-awakened.
The fact that the uptime command may have been available since prior to hibernation doesn't detract from it now being an otherwise incorrectly titled tool and while obviously still valuable for permanently on computers, it fails to give an accurate reflection of the time of a machine that utilises availability on demand.
If you think that was an insult you have lived a particularly sheltered life.
This being Linux, if you don't like uptime, you are at liberty to amend it to suit your personal proclivities. Submit your updates to LKML - there you will become acquainted with true masters in personal vilification.
Maybe "uptime" is just incorrect (historical) name for this command. It only show you the difference between your current time and time of machine start which was stored somewhere at boot time. For purpose you want you need a tool which works on backround all the time and just counting seconds. You can probably use information from /proc/timer_list if you have it. For example my system show there a real time when system was running in 3rd row.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.