LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-29-2013, 12:37 PM   #1
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Rep: Reputation: 98
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.

Thanks
 
Old 06-29-2013, 02:15 PM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
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.
 
Old 06-30-2013, 12:19 AM   #3
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Original Poster
Rep: Reputation: 98
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?
 
Old 06-30-2013, 01:19 AM   #4
Nauntilus
Member
 
Registered: Oct 2005
Distribution: All of them
Posts: 140

Rep: Reputation: 18
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.
 
Old 06-30-2013, 02:14 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by vdemuth View Post
So 'uptime' is not really a fair representation of either the computer activity or indeed an accurate description of itself.
Don't be so presumptuous - uptime predated laptops, let alone Linux support of hibernate/suspend.
 
Old 06-30-2013, 02:58 AM   #6
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Original Poster
Rep: Reputation: 98
Quote:
Originally Posted by syg00 View Post
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.

I'll ignore the insult BTW.

Cheers
 
Old 06-30-2013, 07:37 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 06-30-2013, 11:37 AM   #8
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
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.

Last edited by eSelix; 06-30-2013 at 11:38 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
uptime cmd shows 5 users but thats wrong thoron! Slackware 7 02-21-2012 02:58 PM
Server restarted but uptime shows different output sampappachan_nyc Linux - Server 3 10-10-2011 03:32 PM
init uptime longer than system uptime? m4rtin Linux - Server 1 09-15-2010 07:45 AM
cli hibernate works but gnome panel hibernate fails BCarey Linux - Desktop 1 06-08-2007 10:21 AM
uptime shows 3 users on system when there is only me. Is this normal? MichaelD Linux - Security 3 05-21-2005 11:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration