ntpd refclock GPSD_JSON just stops working.
I have a long running time server. It has gpsd on a GPS, doing PPS. gpsd is reporting time over refclocks SHM and GPSD_JSON. This is a production server, things are only changed infrequently, the gpsd is rock solid.
After a while the GPSD
_JSON stops reporting time. The SHM
keeps running.
catbert:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
-clepsydra.hpl.h .GPS. 1 u 36 64 377 26.297 -0.420 0.133
-204.152.184.72 .GPS. 1 u 34 64 377 29.243 -2.724 0.357
nist.netservice .ACTS. 1 u 853 1024 0 59.516 -0.373 0.000
+spidey.rellim.c .GPS1. 1 s 58 64 376 0.189 -0.248 0.025
SHM(0) .GPS. 0 l 15 16 377 0.000 11.468 2.281
+SHM(1) .GPS1. 0 l 15 16 377 0.000 0.203 0.404
*SHM(2) .SHM. 0 l 13 16 377 0.000 -0.225 0.023
GPSD_JSON(0) .GPSD. 0 l 133m 64 0 0.000 -123.69 0.000
GPSD_JSON(128) .GPSD. 0 l 134m 64 0 0.000 0.895 0.000
Notice the GPSD_JSON
reflock is dead, while the SHM is still working!
SHM(0) is NMEA time
SHM(1) is PPS time
GPSD_JSON(0) is NMEA time from the same gpsd as SHM(0)
GPSD_JSON(128) is GPS time from the same gpsd as SHM(1)
Wild card: SHM(2) is PTP from another local server!
Killing and restarting ntpd fixed the GPSD_JSON() crash.
Here is my mtpq -p after the ntpd restart, notice HSM() and GPSD_JSON() are fine.
catbert:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
-clepsydra.labs. .GPS. 1 u 27 64 3 26.393 -0.422 0.719
-204.152.184.72 .GPS. 1 u 28 64 3 29.191 -2.215 0.005
nist.netservice .ACTS. 1 u 24 64 0 0.000 0.000 0.000
+spidey.rellim.c .GPS1. 1 s 6 64 3 0.266 -0.249 0.005
SHM(0) .GPS. 0 l 9 16 77 0.000 12.037 0.821
-SHM(1) .GPS1. 0 l 8 16 77 0.000 0.638 0.351
*SHM(2) .SHM. 0 l 6 16 77 0.000 -0.248 0.033
-GPSD_JSON(0) .GPSD. 0 l 22 64 3 0.000 -130.39 0.104
+GPSD_JSON(128) .GPSD. 0 l 21 64 3 0.000 0.134 0.817
[edited to fix typos and use new driver nomenclature]
Edited by Eric S. Raymond