Ntp -- getting it to work

Michael keybounce at gmail.com
Mon Nov 24 08:11:43 PST 2014


>> Is there any reason to have both services running? Can't you just unload the pacemaker plist and let ntpd handle things like the big boy it is on othe OSes?
> 
> This may be of use.
> 
> https://discussions.apple.com/thread/5604114

Oh wow:

"This eventually led me to notice the timestamps on the drift file were never changing. Enter this command in your terminal window to read the timestamp:
     ls -la /var/db/ntp.drift

On my machine (Mac mini) it would always return the same time even though the contents are being updated by ntpd.
...
On a hunch, I used the "touch" command to update the timestamp to the present moment:
     sudo touch /var/db/ntp.drift
Surprisingly, this had an effect on the time so I wrote a simple python script to read the drift file once a minute and "touch" the drift file if it had changed. I've been running this script continuously for several days now and my time has returned to the accuracies I experienced prior to the 10.9 upgrade.

Frankly, I don't understand how the drift file can be changed by ntpd while the timestamp remains constant. I'd be very interested to hear if anyone else can confirm this observation."

So yea:
1. How can the file change and not show a timestamp, and
2. WTF is going on with apple's NTP?, and
3. Is there any way to change the "tick" value? as reported by

keybounceMBP:config michael$ sysctl kern.clockrate
kern.clockrate: { hz = 100, tick = 10000, tickadj = 0, profhz = 100, stathz = 100 }

The idea here is that changing that "10000" to account for your system's long-term average drift will eliminate the need for most adjustments by ntp in the first place.

(Maybe I should ask: Any *documented* way? I was able to do this in a linux system a long time ago without too much trouble, but linux documented where the value was stored/how it was accessed, and trying to find the developer documentation for obscure feature X is hard)


More information about the macports-users mailing list