ntpd, timed and chronyd in 10.13

It looks as though the ntpd NTP daemon has been retired from time-keeping duties in 10.13 and replaced by timed.


I had never heard of timed before, but I gather from the man page that it has been in use on iOS devices since 1OS 10.5


From what shows up in the logs and by observing the network activity, timed appears to be a simple sntp client - i.e. it polls the NTP periodically (15 minutes) and uses the settimeofday() system call to set the sytem clock. I assume it has some cleverness to avoid stepping the clock backwards but there is no way to tell.


This explains why I no longer see ntpd in the list of active processes.


There is a bug, introduced in 10.13, with the system call adjtime(), used by ntpd to slew the system clock without making time go backwards. Unfortunately, the adjtime() call is totally broken in 10.13, yielding huge errors if you attempt to slew the clock by a negative amount. I filed a bug report 6 weeks ago, including a test case that demonstrates the problem, but since it appears the new (to macOS) timed is not affected by the bug, it seems to have attracted very little interest.


chronyd is replacement software for ntpd (and now timed) that has many advantages over either of those daemons and like ntpd, makes use of adjtime() to slew the clock. Until this adjtime() bug is fixed chronyd will produce terrible results and attempt to slew the clock by a huge amount. A new release of chronyd will fix the problem but earlier versions will fail spectacularly.


It sure would be nice if someone from Apple reads this and finds out what is happening with bug #32808867

Accepted Reply

The problem with adjtime() is resolved in macOS 10.13 beta 5 and the bug is closed.

Replies

The problem with adjtime() is resolved in macOS 10.13 beta 5 and the bug is closed.

Thanks for your posting your question. These kinds of things are easy to forget when your poking around wondering, "why isn't ntpd running?!"