Re: NTP.conf pool vs server
- Date: Wed, 7 Jun 2017 10:56:34 -0400
- From: Greg Wooledge <wooledg@xxxxxxxxxxx>
- Subject: Re: NTP.conf pool vs server
On Wed, Jun 07, 2017 at 10:35:23AM -0400, Gene Heskett wrote:
> Begin rant:
> From someone who is currently battling a fresh jessie install that didn't
> even come with ntpdate installed, and which using the above format
> in /etc/ntp.conf is still about 12 hours off on an rpi-3.
The ntpdate package has been deprecated for some time now, in Debian.
You don't need it. Simply install the ntp package, and configure the
/etc/ntp.conf file (which admittedly is not clearly documented).
Current versions of Debian have folded the ntpdate functionality into
ntp. The /etc/default/ntp file has (or should have!) this:
This starts ntpd with the -g option, which tells it that it's allowed
to slam the clock forward or backward exactly once when it starts up,
mimicking what ntpdate used to do.
> Installing ntpdate and attempting to start it gets me a no servers found
> message, yet they are defined as discussed above, and the network is
> fully accessible to all other forms of communication.
Sounds like something is misconfigured, though we can't tell what it is
without additional info.
> But a manpage that actually tells us how to do that must be sick bird,
> because its not been written yet. Man page writers please get real, and
> tell us how to do something like getting our home networks all
> synchronized to our routers which can then broadcast it to the rest of
> our network.
On the machine that you want to act as your local network's time server:
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
And make sure you didn't change the lines under the comment that says
"By default, exchange time with everybody, but don't allow configuration."
On your other machines:
That's basically it. Make sure the hostname is resolvable. If you have
issues with name resolution not being available sometimes, then you might
want to add your.time.server to /etc/hosts.
To verify that things are running, use ntpq -p:
svr5:~$ ntpq -p
remote refid st t when poll reach delay offset jitter
-22.214.171.124 126.96.36.199 2 u 776 1024 377 80.415 -8.341 0.239
*clocka.ntpjs.or 188.8.131.52 2 u 250 1024 377 9.780 0.361 0.556
+up2.com 184.108.40.206 2 u 490 1024 377 31.761 -1.224 0.474
+jarvis.arlen.io 220.127.116.11 2 u 477 1024 377 36.764 -2.368 4.547
And that's why you use multiple public time servers -- they aren't very
accurate, so you need lots of them. The daemon can decide which ones
to ignore, and so on.
The output of this -p thing is not documented, so you have to guess what
it means. I think the "-" in column 1 means "this server sucks, so I'm
not really paying attention to it", and "+" means "pretty good", and "*"
means "this is my favorite". But that's just a guess. There's nothing
in the ntpq man page about it at all.