LinHES Forums
http://forum.linhes.org/

Mythwelcome in R5.5 does not wake machine
http://forum.linhes.org/viewtopic.php?f=11&t=18587
Page 5 of 5

Author:  nicom [ Wed Jan 28, 2009 4:49 pm ]
Post subject: 

I will have to wait and see how accurate my clock is.

I did some research into manually syncing the clock and came up with more questions. Shouldn't ntp keep the clock up to date or is that a different clock?

In this post, mjl inserts ntpdate -u pool.ntp.org at the bottom of /etc/init.d/bootmisc.sh.
Marc, is that how you do it?

Author:  alien [ Thu Jan 29, 2009 4:35 am ]
Post subject: 

Take a look at man hwclock.

Basically, there are two clocks:

There is the system time which is what linux uses. NTP keeps it up to date.

Then there is the HW clock. This is what keeps time when the PC is off. It is also the one that will wake the PC. Normally, the system time is written into the HW clock on shutdown to keep it accurate. If it is never updated, it may drift. This despite the fact that the system time is still accurate because of NTP.

Author:  marc.aronson [ Thu Jan 29, 2009 9:21 am ]
Post subject: 

nicom wrote:
I will have to wait and see how accurate my clock is.

I did some research into manually syncing the clock and came up with more questions. Shouldn't ntp keep the clock up to date or is that a different clock?

In this post, mjl inserts ntpdate -u pool.ntp.org at the bottom of /etc/init.d/bootmisc.sh.
Marc, is that how you do it?

Yes -- I had added the following at the end of bootmisc.sh:
Code:
ntpdate -u pool.ntp.org

Author:  alien [ Thu Jan 29, 2009 10:35 am ]
Post subject: 

Just to clarify:

Putting ntpdate -u pool.ntp.org in bootmisc will ensure that the system time is correct on booting even if the hwclock has drifted or is otherwise incorrect.

However, if you are using mythwelcome to wake up the machine, it will still wakeup based on the (possibly incorrect) hwclock.

Author:  nicom [ Thu Jan 29, 2009 5:19 pm ]
Post subject: 

WOW! That man hwclock page gives a really good explanation.

So the problem as I understand it is ntpdate only updates the system time not the HW clock. Putting HWCLOCK=NOACCESS in /etc/init.d/hwclock.sh prevents the system time being written into the HW clock on shutdown. Could I include "hwclock --systohc" somewhere earlier in the hwclock.sh file to set the HW clock to system time before I stop access?

Author:  alien [ Thu Jan 29, 2009 6:38 pm ]
Post subject: 

You got it.

As for moving the hwclock calls around, you might want to try it. Right now, it is called before the RTC alarm is set. You might want to try calling it after the RTC alarm is set (after the chunk of code that starts with "# Hooks for mythwelcome. On shutdown...").

Page 5 of 5 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/