-2

edit: I am essentially attempting to utilize the NTP code from section 5 of RFC 1129 from the command-line. Simply setting the clock, or even making an adjtime call is insufficient. I'd like to utilize the pre-existing NTP code for properly synchronizing clocks, but without the network part.

I have a system that cannot reach the internet, but has access to a high-precision clock. I would like to periodically poll that high precision clock for the time, and utilize the control system in NTP to synchronize the system clock.

Does anyone know how to feed input to NTP without faking an NTP server?

Ideally, I would be able to feed it the current time on the command-line, and have it use that as another point for synchronizing the clock.

bash ~ $ something 1416899507
  • maybe `date` (see the [manpage](http://unixhelp.ed.ac.uk/CGI/man-cgi?date))? –  Nov 25 '14 at 07:20
  • I have a vague memory of a date command that would not reset the date, but would make the appropriate adjtime call to set a reasonable intercept, but even that is less desirable (hwclock and adjtimex come closer, but not quite). I'm basically trying to make use of section 5 of RFC1129 without having to also make of the protocol itself. – hypersphere Nov 25 '14 at 16:28

1 Answers1

0

Looking into refclock_nmea.c it appears as though a simple mechanism would be to feed ntpd time values from GPS NMEA sentences. Alternatively, it doesn't appear to be that difficult to just implement a custom refclock driver. David Mills has a tutorial available: http://www.eecis.udel.edu/~mills/ntp/html/howto.html