From owner-freebsd-questions@FreeBSD.ORG Sat Mar 14 02:48:27 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0BE018B for ; Sat, 14 Mar 2015 02:48:27 +0000 (UTC) Received: from dragon.rutgers.edu (dragon.rutgers.edu [128.6.4.3]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1E3C4E for ; Sat, 14 Mar 2015 02:48:26 +0000 (UTC) X-ExtScanner: Niversoft's Regex Matcher X-Virus-Scanned: by dragon-cgpav-clamav-v1.3b Received: by dragon.rutgers.edu (CommuniGate Pro PIPE 6.0.11) with PIPE id 119425518; Fri, 13 Mar 2015 21:48:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on spamfilter2.cs.rutgers.edu X-Spam-ASN: X-Spam-Status: No, score=-32.4 required=5.0 tests=ALL_TRUSTED,BAYES_20, KHOP_THREADED,LCSR_THREAD,RUMAILX shortcircuit=no autolearn=disabled version=3.3.1 X-Spam-Relay-Country: X-Spam-Language: en X-Spam-Level: Received: from almini.rcthomas.org (account rbthomas@dragon.rutgers.edu [208.53.120.31] verified) by dragon.rutgers.edu (CommuniGate Pro SMTP 6.0.11) with ESMTPSA id 119425517; Fri, 13 Mar 2015 21:48:05 -0400 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: How to adjust clock frequency in FreeBSD 10.1 ? From: Rick Thomas In-Reply-To: <61602B0F-2114-4B65-A576-34EDDF94EAFA@pobox.com> Date: Fri, 13 Mar 2015 18:48:04 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3FCD9F24-D319-41D2-A670-53A8E2ACE16D@cs.rutgers.edu> References: <54EDC2DD.8060307@gmx.de> <61602B0F-2114-4B65-A576-34EDDF94EAFA@pobox.com> To: FreeBSD Questions X-Mailer: Apple Mail (2.1878.6) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 02:48:27 -0000 > On 02/12/15 04:09, Rick Thomas wrote: >> I=92ve got a machine with a really bad clock. When I run NTPD on it, >> the freq goes straight to 500.0 (over a period of a few days) and >> stays there, while the offset grows and grows. >>=20 >> I recently switched this machine from Debian Linux to FreeBSD >> (wanting to learn more about FreeBSD). Under Linux, I used >> adjtimex to modify the TICK value and (once I had converged on the >> right TICK value) NTP was able to stabilize the clock. >>=20 >> Is there an equivalent hack for FreeBSD? On Feb 25, 2015, at 4:41 AM, lokadamus@gmx.de wrote: > You can use a cronjob with ntpdate to synchronize your clock. > But ntpd shouldn=92t run, when ntpdate is used. >=20 As it turns out, current versions of ntpd will do as well as (actually = better than) periodic ntpdate =97 even under such adverse circumstances = as this machine. What it does is to attempt to slew the time using its = normal algorithms until the frequency adjustment gets pegged at 500ppm = and the offset is over 1 second. Then it steps the clock and starts the = game all over. This is better than previous versions of ntpd and xntpd. = They would get to that point and abort =97 on the theory that something = was acutely wrong and needed human operator attention. Current versions = at least have the option of plugging on as best as possible. So, with current ntpd, the system clock is never more than about 1 = second off from network time. And for a normal desktop machine (or ever a small-/home-office server) = that=92s really good enough and I should stop complaining. BUT=85 The trouble is, I=92m a =93time nut=94 and I keep this machine (and a = few others) around specifically as a test case =97 to prove that it *is* = possible to keep good time (sub millisecond offsets from a GPS server on = the same LAN) even with machines that are out of spec, as long as they = are *reliably* out of spec. I=92ve succeeded in twisting Linux to my ends as noted in my original = post (quoted above), but so far I haven=92t found a way to do that for = FreeBSD, short of custom modifications to the kernel and/or ntpd. Any and all suggestions will be gratefully received. Enjoy! Rick PS: Does anybody know if there=92s a FreeBSD package for P-HK=92s = Ntimed?