clock too slow - big time offset with ntpdate

Doug Barton dougb at FreeBSD.org
Wed May 2 17:49:57 UTC 2007


Martin Dieringer wrote:

> On Wed, 2 May 2007, John Walthall wrote:
> 
>> On Tue, May 01, 2007 at 08:50:10PM +0200, Martin Dieringer wrote:
>>> I think it has to do with powerd, if I kill that, the time stays 
>>> correct.
>>
>> With powerd enabled, are you able to maintain a "reasonably"
>> correct time with frequent NTP syncronizations? Sorry if it's just
>> me, but I am not quite clear about that, from what has been written
>> already.
> 
> I would have to update every minute at least and would still be more
> than 5 seconds off.

I think you misunderstand how ntpd works vs. how ntpdate works. ntpd 
is a daemon, so you don't run it every minute, it runs in the 
background and keeps the clock up to date.

Assuming that 1.2.3.4 is the IP address of the server you're using for 
ntpdate, create a file named /etc/ntp.conf that looks like this:

server 1.2.3.4
driftfile /var/db/ntp.drift
logfile /var/log/ntpd

Then make sure you have the following in /etc/rc.conf:

ntpdate_enable="yes"
ntpdate_flags="-sb 1.2.3.4"
ntpd_enable="yes"

Turn off all of the power management, and any other service that might 
be affecting the clock, and then reboot. If your system is able to 
maintain correct time under these circumstances, start adding things 
in until you find the culprit and let us know.

If you're still having problems, it might be the HZ setting. I 
upgraded an older box to 6-stable recently and the clock went nuts in 
spite of having ntpd running. The ntpd process couldn't adjust fast 
enough. I solved it by putting

options         HZ=100

in my kernel config file.

hth,

Doug

-- 

     This .signature sanitized for your protection


More information about the freebsd-stable mailing list