Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2006 12:07:13 -0400
From:      wc_fbsd@xxiii.com
To:        freebsd@dfwlp.com,freebsd-questions@freebsd.org
Subject:   Re: Proper Method of Time Sync?
Message-ID:  <6.2.3.4.2.20060414115321.02e7f110@mailsvr.xxiii.com>
In-Reply-To: <5507.208.11.134.3.1145029242.squirrel@mail.dfwlp.com>
References:  <5507.208.11.134.3.1145029242.squirrel@mail.dfwlp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 11:40 AM 4/14/2006, Jonathan Horne wrote:
>i have read about 2 methods to sync the time on a freebsd box.
>...i have a workstation and a server, which i originally did method 
>1 on, but soon enough, time drifted quite a bit.  so i switched it 
>to the 2nd method, and they appear to be sync'd perfectly.  a third 
>box i set up, i did only method 2, and this one did not stay synced 
>at all.  after i manually ran 'ntpdate -v -b us.pool.ntp.org', this 
>box straightend up.

First off, ntpdate is obsolete, and will be retired "sometime in the 
future".  Its functionality has been incorporated into ntpd.  I think 
your problem is a limit in ntpd that's enabled by default.  There is 
a limit on how large a correction ntpd will make at one time, even at 
boot up.  ntpdate isn't that picky and always just syncs, even if the 
offset is large.

Try some rtfmp on ntpd, ntpdate and ntpd.conf.  I run ntpd on one 
server, with a flag (-g) set to always sync, eg:

rc.conf:
ntpd_sync_on_start="YES"        # Sync time on ntpd startup, even if 
offset is high
ntpd_flags="-A -p /var/run/ntpd.pid"

And ntp.conf:
server          rolex.usg.edu
driftfile       /etc/ntp.drift
logfile         /var/log/ntpd.log
restrict 208.62.177.32 mask 255.255.255.224 nomodify notrap

My other servers and desktops are similarly configured, but sync off 
the first server.

Be sure to specify the driftfile;  ntpd will "learn" how fast or slow 
your clock is and record it, so it can apply corrections when/if an 
internet connection isn't up.  Be sure the file exists and has some 
number.  You can initialize with:  echo "0" > /var//db/ntp.drift 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.2.3.4.2.20060414115321.02e7f110>