[SOLVED] Re: ntpd never achieves synchronized, even with PPS source; ntpdig KOD
Robin H. Johnson
robbat2 at gentoo.org
Tue Dec 18 19:46:44 UTC 2018
(sending to the list because it contains the solution)
TL;DR: compiling in refclock_local, but leaving it out of config disables sync
On Tue, Dec 18, 2018 at 01:08:27AM -0800, Hal Murray wrote:
>
> Thanks. I don't see anything fishy in the syslogs. (but still looking)
>
> How long have you waited? It didn't find an old drift file so it is going
> through the long process of figuring out what the drift should be.
The drift file has been written out with zeros for a long time now.
> From the previous message:
Did drop the -x as well.
> "probable KOD packet" The "DOWN" in the text part of the packet dump looks
> like a code. I can't find sane source code that sets it. You didn't enable
> lockclock did you?
--enable-lockclock wasn't set during compile, but this DID lead me to
making a useful discovery:
refclock_local was enabled as a compile-time option, probably from when
I was ensuring all Gentoo-user-accessible code paths compiled.
Turning off that got me a useful messages in the logs:
$ ...logs... | fgrep ntpd | fgrep -e CLOCK: -e 'PROTO: 0.0.0.0 ' -e Starting
2018-12-18T19:21:50.000000+00:00 x ntpd[18266]: INIT: ntpd ntpsec-1.1.2 2018-12-18T19:18:48Z: Starting
2018-12-18T19:21:50.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 8811 81 mobilize assoc 28431
2018-12-18T19:21:50.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 8811 81 mobilize assoc 28432
2018-12-18T19:21:50.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 8811 81 mobilize assoc 28433
2018-12-18T19:21:50.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c01d 0d kern kernel time sync enabled
2018-12-18T19:21:50.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c012 02 freq_set kernel 0.000000 PPM
2018-12-18T19:21:50.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c016 06 restart
2018-12-18T19:21:51.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c41c 0c clock_step +0.774002 s
2018-12-18T19:21:52.000000+00:00 x ntpd[18267]: CLOCK: time stepped by 0.774002
2018-12-18T19:21:52.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c415 05 clock_sync
2018-12-18T19:21:54.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c418 08 no_sys_peer
2018-12-18T19:21:55.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c413 03 spike_detect +0.142550 s
2018-12-18T19:21:56.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c418 08 no_sys_peer
2018-12-18T19:26:55.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c41c 0c clock_step +0.148602 s
2018-12-18T19:26:55.000000+00:00 x ntpd[18267]: CLOCK: time stepped by 0.148602
2018-12-18T19:26:55.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c415 05 clock_sync
2018-12-18T19:26:56.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 c418 08 no_sys_peer
2018-12-18T19:26:59.000000+00:00 x ntpd[18267]: PROTO: 0.0.0.0 0428 08 no_sys_peer
# ntpwait -v
Waiting for ntpd to synchronize... OK! (186.4 seconds)
# ntpdig
2018-12-18 11:27:53.262696 (+0700) +0.000006 +/- 0.000046 localhost ::1 s1 no-leap
# ntpq -p -n
remote refid st t when poll reach delay offset jitter
=======================================================================================================
xSHM(0) .GPS. 0 l 3 4 377 0.0000 -138.015 4.0644
*SHM(1) .PPS. 0 l - 4 377 0.0000 0.3231 0.4445
pool.ntp.org .POOL. 16 p - 256 0 0.0000 0.0000 0.0001
gentoo.pool.ntp.org .POOL. 16 p - 1024 0 0.0000 0.0000 0.0001
ca.pool.ntp.org .POOL. 16 p - 256 0 0.0000 0.0000 0.0001
-144.217.75.74 152.2.133.55 2 u 11 64 1 64.9294 1.5856 0.3948
+66.70.172.17 149.56.121.16 3 u 11 64 1 60.7845 0.3021 0.8245
+207.34.48.31 167.114.156.48 3 u 11 64 1 13.9419 0.8344 0.3937
+54.39.13.155 213.251.128.249 2 u 11 64 1 60.6834 0.5393 0.7418
-206.108.0.133 .PPS. 1 u 9 64 1 57.1529 0.7156 0.7753
+129.128.12.20 172.30.90.10 2 u 9 64 1 22.8655 1.1881 1.3191
-144.217.181.221 5.56.147.93 2 u 9 64 1 56.3051 0.5777 0.4140
+209.115.181.107 158.69.226.90 3 u 9 64 1 13.5522 0.9302 0.4460
So improvements:
- BUG: figure out why refclock_local being simply compiled-in and not in the config at all prevented sync.
- MAYBE: log if the clock would have been stepped but isn't because $reasons
- DEBUGGING: during startup AND version output, log what refclocks are compiled-in
- DEBUGGING: log slewing changes
--
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail : robbat2 at gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1113 bytes
Desc: Digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20181218/7a664429/attachment.bin>
More information about the devel
mailing list