The s6-sntpclock program

s6-sntpclock is a small SNTP client. It connects to a SNTP or NTP server, computes an estimated discrepancy between the local clock time and the absolute time given by the server, and outputs it on stdout.


     s6-sntpclock [ -f ] [ -v verbosity ] [ -r roundtrips ] [ -t triptimeout ] [ -h throttle ] [ -T totaltimeout ] [ -e errmax ] [ -p port ] ipaddress | s6-clockview



A word on ntpd

From a Unix software engineering standpoint, the well-known ntpd program is an eldritch abomination. The main reason for it is that, just like its lovely cousin BIND, ntpd performs a lot of different tasks in a unique process, instead of separating what could, and should, be separated. This is confusing for both the programmer and the software user.

And of course, no matter how many layers of complexity you add onto ntpd, it will never be able to give accurate time in the vicinity of a leap second, since the very protocol is flawed by design - but the ntpd authors cannot be blamed for that. Also, the ntpd writers, not the designers, should be praised: the history of ntpd security flaws is remarkably small, which is quite a feat for a huge monolithic root daemon.

Network synchronization is important, NTP has its perks and valid use cases, and its existence is a good thing. However, I wish that the main NTP implementation weren't written as a big fat clumsy process running as root. s6-sntpclock together with s6-clockadd aims to provide a small, simple tool to keep system clocks, especially in embedded devices, synchronized to a NTP server.