ntpd configutration -- a small suggestion from the peanut gallery
doug at safeport.com
doug at safeport.com
Wed Jun 5 21:12:17 UTC 2019
On Wed, 5 Jun 2019, Ronald F. Guilmette wrote:
> In message <c705f5737cf441abe1b039b5d212ca34e98360d8.camel at smormegpa.no>,
> Matthias Oestreicher <matthias at smormegpa.no> wrote:
>> NTP works out of the box, but does not accept big time changes unless you run it with
>> the -g option. I think it's not ntp's fault.
> OK. Thanks. It now appears that this was indeed the issue, and I did
> need the -g option. The ntpd daemon -was- dying entirely, shortly after
> starting up, but now I have run it manually with the -g option and also
> with the other options that it normally gets when it has been started
> via "/etc/rc.d/ntpd start" and now all seems to be well.
> (Apparently, adding ntpd_sync_on_start="YES" to /etc/rc.conf is the
> particular magic that should be used to cause ntpd to always be started
> with the -g option, which suits me just fine. I'm not sure why this
> isn't used by default, but I guess that some folks are a lot more
> worried about their time getting set wrong somehow than I am.)
> Just one more small thing... The man page for ntpd says, very explicitly,
> undetr the description of the -g option, that when and if ntpd finds
> that the time adjustment needed is too big, it will exit *and* also
> write a message (presumably explaining why it did that) to "the system
> log". I am assming that for a fresh new system that has not yet been
> fiddled too much, that means the message in question... which explains
> why ntpd has elected to commit suicide... should appear in the
> /var/log/messages file. Certainly I *am* seeing other messages from
> ntpd in that file. But I am quite certainly *not* seeing any message
> in that file and tagged with the name "ntpd" that mentioned either that
> ntpd was electing to commit suicide *or* the reason why it might be
> doing so.
> Did I just miss those ntpd death messages somehow?
I'm not sure. Somewhere in the ntp docs it says ntpd will not change the time if
the offset is too large. On the server where I either connect to a local ntp
server or to a set I define, ntpd starts but in affect does nothing. Using the
current FreeBSD setup I find that sometimes ntp will not start. For me this
generally has meant ntpd got started before DNS got going. At least that's the
errors I have in /var/log/messages indicate.
You can use ntpq to check the status of things ntp. There are lots of "neat"
commands, I just use lpeer. That will give something like:
remote refid st t when poll reach delay offset jitter
+ntp.wdc1.us.lea 18.104.22.168 2 u 903 1024 377 6.661 2.560 2.170
*ntp.your.org .CDMA. 1 u 131 1024 377 27.607 -1.345 2.149
+22.214.171.124 126.96.36.199 2 u 835 1024 377 67.670 -2.897 1.770
If ntp is not running you get something much less informative.
As for the time zone setting I have since FreeBSD day 1 (1996) said no to the
system install prompt that says "answer no ..." and set the time zone to the
physical locale of the server. I sometimes go to the UK, then I use tzsetup to
change the time zone to zulu (local time). I've never had any reason to vary
More information about the freebsd-questions