Re: [chrony-dev] Wake from sleep on OS X |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] Wake from sleep on OS X
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Wed, 2 Dec 2015 14:31:24 +1300
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a0-2; h=Feedback-ID:X-Smtpcorp-Track:To:Message-Id:Date: From:Subject; bh=pYkZ36yN+cFKK/xDb06O16kpjhIrP51JZhiG2MhT1gY=; b=xQ6/8Mpspo5i ESZHdLrHyaj3DbeseMqWxWUZyqTQL10lqJN6Mi/xNSatJCmMcr7uhOmkZ9QtcsZuaVvoUKIaE3w/D bPlGjNrnQfsCyqRFvY02vU5FbiCszC0TRzeBpS4QB4xBm18x2xlT5byaFHDh50In4NSWOzqwqcXcg 7jiNmoRO77FatCu6IjjTHV469Ut5x3I97Y9mQia1EsSjORuePa+2No1Dsb2vTGxINlOhp9bgyZ/d2 93QftVkgiW28f4/WwC7m26z6wSLf0z81yJuknruHjXdImZZi0H+BwhJSlgu949LYd1bEMHJx4AkO4 7nUELKMSaLKisZTptbUChQ==;
- Feedback-id: 149811m:149811acx33YQ:149811sT3zs2fOqZ:SMTPCORP
> On 2/12/2015, at 12:48 PM, Bill Unruh <unruh@xxxxxxxxxxxxxx> wrote:
>
>
> I have no idea how OSx timekeeping works. However clearly there is a way of
> setting the rtc and setting the system clock. hwclock is simply a package
> which does those things on Linux as a user runnable program. I also do not
> know what the difference is between "setting the time manually" and "run
> hwclock". hwclock is how a user sets the clock, either the system clock from
> rtc or rtc from the system clock, under linux. What is the procedure on OSx?
> Anyway as you can see I am way out of my depth here.
>
The usual means for adjusting time in OS X is to use the System Preferences gui, either setting the time manually (I think its probably just a wrapper around the date command) or enabling ntpd. It can also be set as superuser from the command line using the 'date' command but I doubt that many people would ever do that.
The wrapper script thats is run to start ntpd uses sntp to initially set the system time and step the clock if necessary. The script then starts ntpd.
These methods will eventually issue a settimeofday() system call. I had a look in the OS X kernel and settimeofday() seems to be the only exported mechanism for updating the hardware clock.
There is no separate hwclock type of program and there is no /dev/rtc device or equivalent. I guess Apple decided it wasn't necessary because the user only has the 2 choices I outlined. I suppose one option would be to write a program that does gettimeofday()/settimeofday() to be invoked at shutdown, but thats another binary that has to be maintained, installed and activated.
I had a read of all the rtc.... directives available for the chronyd configuration and it looks to me as tho those mechanisms are only supported on Linux.
I think the best option is periodic updates from chronyd via the settimeofday() system call. Nothing else is setting the h/ware clock and since it seems as tho rtc recovery is not supported, settimeofday() wouldn't be trading on anyones toes.
However, it does surprise me that its not automatic, especially if adjtime() has been called and the clock deliberately deviated away from the rtc setting. I had assumed this to be the case and clearly I was wrong, my clock having drifted to 6 seconds offset from NTP time.
Anyway - I am sure Miroslav will be able to help resolve this.
--
Bryan Christianson
bryan@xxxxxxxxxxxxx
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.