View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 66 posts ] 
Go to page Previous  1, 2, 3, 4, 5

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Wed Jan 28, 2009 4:49 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
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?

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 4:35 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
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.

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 9:21 am 
Offline
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location: California
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

_________________
Marc

The views expressed are my own and do not necessarily reflect the views of my employer.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 10:35 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
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.

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 5:19 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
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?

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 6:38 pm 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
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...").

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 66 posts ] 
Go to page Previous  1, 2, 3, 4, 5



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu