This is on a Raspberry Pi 3 with Raspberry Pi OS Bookworm 64 Bit,
ie. Debian 12. I have uninstalled systemd-timesyncd and installed
ntpsec, then have commented out the 4 NTP servers {0,1,2,3}.debian.pool.ntp.org, and instead added my own server with
server -6 my-ntp.my-domain
When I call ntpdate my-ntp.my-domain manually it steps the time as
expected. But then, ntpd doesn't sync the local clock to the NTP
server, although it seems to consider that server's clock stable:
$ ntpq -p
remote refid st t when poll reach delay offset jitter
=================================================================================
+my-ntp.my-domain 237.17.204.95 2 u 29 64 377 0.4696 -0.0378 0.0196
$ ntpstat
unsynchronised
polling server every 1 s
I usually see a '*' in the first row to indicate that the local clock
is in sync with that server. The ntpq(8) man page says about +:
+ │ included by the combine algorithm
In /var/log or with journalctl I don't see any hint what might be the
reason. When I let it run, the offset as shown by ntpq grows over
time.
Does it work without the -6 option?
Does it work if you bring back the pool servers?
Dan Ritter <dsr@randomstring.org> writes:
Does it work without the -6 option?
No, the same problem. And ntpq shows that IPv6 is also used, when -6
isn't given. But, my NTP server is used by other hosts in the network
and that works fine.
Does it work if you bring back the pool servers?
Yes, it does. I get many NTP servers (much more than the 4 pool
entries), one marked wirh '*', some with '+', some with '#', and a few
with '-'.
Can the problem be caused by Debian's change from ntp to ntpsec? Do I
need to install keys for my NTP server? Quite unusual, that no log
messages appear in the logs.
#3 Post by michael_S » 2023-09-26 13:54<br>Solved the problem for me. The cause behind this behaviour is the following line in /etc/ntpsec/ntp.conf<br>Code: Select all<br>tos minclock 4 minsane 3 <br><br><b id="ext-gen960">The option minsane 3implies to (my understanding) that the ntpd wants at least 3 "good" NTP servers</b>, i.e. servers that somewhat agree. I changed this to<br>Code: Select all<br>tos minclock 4 minsane 2 <br><br>And now it works for me with 2 NTP servers available. <b>If
When I call ntpdate my-ntp.my-domain manually it steps the time as
expected. But then, ntpd doesn't sync the local clock to the NTP
server, although it seems to consider that server's clock stable:
$ ntpq -p
remote refid st t when poll reach delay offset jitter
=================================================================================
+my-ntp.my-domain 237.17.204.95 2 u 29 64 377 0.4696 -0.0378 0.0196
$ ntpstat
unsynchronised
polling server every 1 s
Dan Ritter <dsr@randomstring.org> writes:
Does it work without the -6 option?
No, the same problem. And ntpq shows that IPv6 is also used, when -6
isn't given. But, my NTP server is used by other hosts in the network
and that works fine.
Does it work if you bring back the pool servers?
Yes, it does. I get many NTP servers (much more than the 4 pool
entries), one marked wirh '*', some with '+', some with '#', and a few
with '-'.
Can the problem be caused by Debian's change from ntp to ntpsec? Do I
need to install keys for my NTP server? Quite unusual, that no log
messages appear in the logs.
Steve
.
I personally am running ntpsec here, making this box a level 2 src, and have redirected most of my machines to it. Nut as a client, ntpsec fails as it cannot slam the correct time at bootup, apparently only adjust drift. So clients should be using chrony, which can force time into sync while
booting.
hobbit:~$ man ntpd
[...]
-g, --panicgate
Allow the first adjustment to be big. This option may appear an
unlimited number of times.
In Debian 12 the default /etc/ntpsec/ntp.conf file contains the lines
# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
tos minclock 4 minsane 3
which means ntpd needs at least 3 servers to choose from. If you
haven't changed that line and you have only one server configured like
your output shows, you can never get synchronisation.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (3 / 13) |
Uptime: | 05:47:05 |
Calls: | 10,388 |
Calls today: | 3 |
Files: | 14,061 |
Messages: | 6,416,799 |