From owner-freebsd-questions@FreeBSD.ORG Fri Apr 14 16:03:24 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8F2216A400 for ; Fri, 14 Apr 2006 16:03:24 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out3.blueyonder.co.uk (smtp-out3.blueyonder.co.uk [195.188.213.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26BAF43D48 for ; Fri, 14 Apr 2006 16:03:24 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [172.23.170.143] (helo=anti-virus02-10) by smtp-out3.blueyonder.co.uk with smtp (Exim 4.52) id 1FUQlX-0000ud-9o; Fri, 14 Apr 2006 17:03:23 +0100 Received: from [80.192.25.195] (helo=[192.168.0.2]) by asmtp-out2.blueyonder.co.uk with esmtp (Exim 4.52) id 1FUQlW-0002gX-OU; Fri, 14 Apr 2006 17:03:22 +0100 Message-ID: <443FC7CA.6090809@dial.pipex.com> Date: Fri, 14 Apr 2006 17:03:22 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.12) Gecko/20060305 X-Accept-Language: en MIME-Version: 1.0 To: freebsd@dfwlp.com References: <5507.208.11.134.3.1145029242.squirrel@mail.dfwlp.com> In-Reply-To: <5507.208.11.134.3.1145029242.squirrel@mail.dfwlp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Proper Method of Time Sync? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2006 16:03:24 -0000 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: >ntpdate_enable="YES" >ntpdate_flags="us.pool.ntp.org" >... 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 >ntpd_enable="YES" >add the file with these contents to /etc/rc.conf: >server us.pool.ntp.org >driftfile /var/db/ntp.drift >restrict 192.168.1.0 mask 255.255.255.0 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 us.pool.ntp.org', 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 track. 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. --Alex