cyoung / stratux

Aviation weather and traffic receiver based on RTL-SDR.
BSD 3-Clause "New" or "Revised" License
1.06k stars 362 forks source link

UPTIME different if unplugged vs shutdown #69

Closed bradanlane closed 8 years ago

bradanlane commented 8 years ago

Assume I power up Stratux at 09:00, then turn it off at 12:00 (noon), and finally power it up again the next day at 09:00. I get different results based on how I turned Stratus off.

If at 12:00 I pull the power from Stratux, then on the "next day" the UPTIME starts at 00h00m00s. If at 12:00 I SSH to the device and execute "shutdown now" then on the "next day" the UPTIME starts at 24h00m00s.

It is as if a controlled shutdown somehow preserves the original start time.

cyoung commented 8 years ago

Isn't "shutdown now" just switching to singleuser mode? "shutdown -h now" probably is what you want to use

bradanlane commented 8 years ago

While logged in a root, issuing "showdown now" yields a different result than simply unplugging the power. I'm just confused as to why.

On Oct 2, 2015, at 8:32 PM, cyoung notifications@github.com wrote:

Isn't "shutdown now" just switching to singleuser mode? "shutdown -h now" probably is what you want to use

— Reply to this email directly or view it on GitHub.

kdknigga commented 8 years ago

I've seen similar behavior with 'shutdown -h now'.

I thought it was odd, but I haven't looked into it. On Oct 2, 2015 19:47, "bradanlane" notifications@github.com wrote:

While logged in a root, issuing "showdown now" yields a different result than simply unplugging the power. I'm just confused as to why.

On Oct 2, 2015, at 8:32 PM, cyoung notifications@github.com wrote:

Isn't "shutdown now" just switching to singleuser mode? "shutdown -h now" probably is what you want to use

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/cyoung/stratux/issues/69#issuecomment-145189638.

cyoung commented 8 years ago

Just tried 'shutdown now' after about 5 minutes uptime, left it off for a minute, pulled the plug and plugged it back in (isn't the only way to bring it back up after a 'shutdown' is to unplug it?), and the uptime started back up at 0. Any other way to reproduce it?

JohnOCFII commented 8 years ago

Assume I power up Stratux at 09:00, then turn it off at 12:00 (noon), and finally power it up again the next day at 09:00. I get different results based on how I turned Stratus off.

Are you referring to Uptime as displayed in the WebUI, or when issuing the -uptime- command at the Linux prompt?

bradanlane commented 8 years ago

The WebUI "uptime" is what ideas looking at. The value comes from the /status websocket messages.

On Oct 2, 2015, at 11:07 PM, JohnOCFII notifications@github.com wrote:

Assume I power up Stratux at 09:00, then turn it off at 12:00 (noon), and finally power it up again the next day at 09:00. I get different results based on how I turned Stratus off.

Are you referring to Uptime as displayed in the WebUI, or when issuing the -uptime- command at the Linux prompt?

— Reply to this email directly or view it on GitHub.

JohnOCFII commented 8 years ago

Just adding an additional datapoint. I just re-imaged my SD card from v0.4r1 to v0.4r2. Even through the Pi was power-cycled and has a new image, the WebUI is showing an uptime of 19h39m42s. (and counting...). I confirmed that the uptime command on the Pi itself is showing a more reasonable 7 minutes. I force-quit mobile safari on my iPad, but no change in behavior. It seems the field is not being initialized properly, or something similar.

bkwny commented 8 years ago

I saw this too. POR and then immediately via the web interface uptime showed about 10 hours.

JohnOCFII commented 8 years ago

I just upgraded my Stratus to the latest Beta (v0.5-b4). I powered up the stratux, which has been powered off for about a month. Looking at the Web UI, it reports Update of 23h17m55s.

skypuppy commented 8 years ago

Since RPi's don't have a battery backed-up clock, they're not real good at time functions until they have finished booting up and getting time set (somehow.)

On 01/04/2016 09:18 PM, JohnOCFII wrote:

I just upgraded my Stratus to the latest Beta (v0.5-b4). I powered up the stratux, which has been powered off for about a month. Looking at the Web UI, it reports Update of 23h17m55s.

— Reply to this email directly or view it on GitHub https://github.com/cyoung/stratux/issues/69#issuecomment-168881288.