Date: Mon, 27 Apr 2015 08:22:41 -0700 From: Freddie Cash <fjwcash@gmail.com> To: Christian Weisgerber <naddy@mips.inka.de> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: System clock always unsynced Message-ID: <CAOjFWZ4mvup_1aH7dVY7cn0t-4=wrb3QRGyNxQBLV8=p6TsXdw@mail.gmail.com> In-Reply-To: <slrnmjsigv.8j.naddy@lorvorc.mips.inka.de> References: <slrnmjsigv.8j.naddy@lorvorc.mips.inka.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 27, 2015 at 7:39 AM, Christian Weisgerber <naddy@mips.inka.de> wrote: > I run OpenNTPD, from ports/net/openntpd, and I've noticed that after > each reboot, the initial system time is further off. (This is quite > noticeable with OpenNTPD, since by default it does *not* jump the > clock on startup like the base ntpd does.) It's as if the RTC was > never synchronized to the system clock. > > Some digging in sys/kern/kern_ntptime.c shows indeed that the RTC is > only synced if STA_UNSYNC is not set, and dumping the value of the > timex struct... > > offset: 0 > freq: 2730304 > maxerror: 84860000 > esterror: 500000 > status: UNSYNC > constant: 0 > precision: 0 > tolerance: 32500000 > state: ERROR > > ... reveals that the clock remains permanently unsynced. Clearly, > OpenNTPD, which uses adjtime(2) to correct offsets and ntp_adjtime(2) > with MOD_FREQUENCY to correct the frequency, doesn't handle this > quite right. > > What *does* an ntpd daemon need to do to sync the clock? > > The ntp_adjtime(2) man page documents struct timex in detail, but > is very vague on what all of this means. > > =E2=80=8BIsn't this why there's a "-s" option for openntpd, which syncs t= he clocks when the daemon starts? And an "openntpd_flags" option in rc.conf =E2=80= =8B =E2=80=8Bfor enabling that option?=E2=80=8B --=20 Freddie Cash fjwcash@gmail.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOjFWZ4mvup_1aH7dVY7cn0t-4=wrb3QRGyNxQBLV8=p6TsXdw>