Proper Method of Time Sync?

Alex Zbyslaw xfb52 at
Fri Apr 14 16:03:24 UTC 2006

Jonathan Horne wrote:

>i have read about 2 methods to sync the time on a freebsd box.
>1) add these entries to /etc/rc.conf:
>... and let the system do a one-time sync at bootup, and rely on this
>single method for timesync.
>2) add this entry to /etc/rc.conf
>add the file with these contents to /etc/rc.conf:
>driftfile /var/db/ntp.drift
>restrict mask nomodify notrap
>so, 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', this box straightend up.
>are both methods required for proper time syncronization, or can one rely
>only on the ntpd method?
If the time is too far out of sync when ntpd starts, it will not correct 
it.  Look at the -g option which allows to it make a major correction once.

That functionality is designed to replace ntpdate, but ntpd can take a 
long time to sync the time first time, so it can make sense to use both 
methods.  ntpdate will set the date fairly accurately, fairly quickly 
and when ntpd comes on-line it will smooth out the edges and keep you on 

For a very long time, ntpdate manual page has described it as about to 
disappear - but since it doesn't go away I think that comment is 
somewhat meaningless and confusing.  I'm fairly sure there was recent 
work on the rcNG scripts for ntpdate to make it operate better with ntpd 
(pick up the list of ntpd servers automatically if none were specified 
specifically for ntpdate).  GIven that, I think the "this program will 
go away" comment in the man page is plain wrong.  It appeared mid 4.X I 
believe, and still appears in 6.0 and apparently 7-current if the online 
man pages can be believed.  Perhaps someone who knows, could clarify.


More information about the freebsd-questions mailing list