Adding NTP servers to Date and Time's dropdown list? Time Servers
#1
Posted 31 December 2012 - 09:43 AM
Thanks!
#2
Posted 31 December 2012 - 12:39 PM
nonjunk, on 31 December 2012 - 09:43 AM, said:
As a practical matter? The best way to address the issue is to do nothing, because NTP takes care of latency. Even if it didn't, a more local server wouldn't necessarily help because latency derives from factors in addition to geographical distance.
That being the case, are you still interested in this as an academic exercise?
#3
Posted 31 December 2012 - 01:29 PM
#4
Posted 02 January 2013 - 12:17 PM
nonjunk, on 31 December 2012 - 01:29 PM, said:
I'll confess to being curious about the interest in more local servers if latency isn't the concern but you noted that the time impact is minor.
I took a dig through the Date & Time preference pane. Not only did I find no supported way to do what you ask, but based on a skim through the binary and the resource files and don't think there's an unsupported way either, short of just using another tool for your NTP configuration entirely. I may write one this weekend. I envision a traditional "dueling list" UI; left side is servers not in use, sorted alphabetically, right side is servers in use sorted by priority. You can move servers between lists by dragging or using activate/deactivate buttons, prioritize by dragging up and down in the active list or using up/down arrows, and add or delete entries at need, with the option to make them immediately active on add.
Thoughts?
#5
Posted 02 January 2013 - 03:18 PM
A friend did a little digging and did come up with a place in the contents where you can find strings for the asia and europe time servers:
FilePath: /System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/DateTime.prefPane/Contents/Resources/English.lproj/TimePref.nib
I opened the .nib file with Textwrangler, and got to the strings with both "asia" and "europe" in the .nib file. For a test, I copied the original nib to the desktop, and then added two strings for the NTP servers I wanted. Restarted the Mac, went to the panels and tried launching Date/time and it told me that the version wouldn't work on an Intel machine. Copied the old .nib back in, and it worked as it did before. I verifed that TextWrangler kept the file type the same too. Don't know what's happening here, since all I did was add the 2 strings. If you feel like doing some detective work, the two strings I'd like to add for now are:
<string> Univ. of IL (ntp-1.cso.uiuc.edu)</string>
<string> NIST Chicago (nist1-chi.ustiming.org)</string>
Again, thanks. My programming skills on a Mac are extremely limited-- I've been using NTP servers back when all we had was dialup. I even helped with a SNTP program for the Apple II and IIGS.
#6
Posted 03 January 2013 - 03:28 AM
nonjunk, on 02 January 2013 - 03:18 PM, said:
A friend did a little digging and did come up with a place in the contents where you can find strings for the asia and europe time servers:
FilePath: /System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/DateTime.prefPane/Contents/Resources/English.lproj/TimePref.nib
I opened the .nib file with Textwrangler, and got to the strings with both "asia" and "europe" in the .nib file. For a test, I copied the original nib to the desktop, and then added two strings for the NTP servers I wanted. Restarted the Mac, went to the panels and tried launching Date/time and it told me that the version wouldn't work on an Intel machine. Copied the old .nib back in, and it worked as it did before. I verifed that TextWrangler kept the file type the same too. Don't know what's happening here, since all I did was add the 2 strings. If you feel like doing some detective work, the two strings I'd like to add for now are:
<string> Univ. of IL (ntp-1.cso.uiuc.edu)</string>
<string> NIST Chicago (nist1-chi.ustiming.org)</string>
Again, thanks. My programming skills on a Mac are extremely limited-- I've been using NTP servers back when all we had was dialup. I even helped with a SNTP program for the Apple II and IIGS.
What I found most discouraging, and frankly somewhat bizarre, in going through the prefpane was that the binary contains explicit functions to return the addresses of each of the 3 default servers. The strings in the nib appear to be used for nothing more than display. I wouldn't suggest that Apple software is perfect, but that's oddly lazy and brittle. Intern or outsourced, perhaps.
#7
Posted 03 January 2013 - 06:46 AM
Like I said, my programming skills on the Mac are nil--I'd be very interested and very grateful for that "dueling list" idea of yours! again--my Thanks!
#8
Posted 03 January 2013 - 12:42 PM
nonjunk, on 03 January 2013 - 06:46 AM, said:
Like I said, my programming skills on the Mac are nil--I'd be very interested and very grateful for that "dueling list" idea of yours! again--my Thanks!
The list was definitely editable prior to OS X. I don't think that particular preference pane has changed substantially in the last decade, though.
I got the UI to my replacement utility roughed out this morning before work. It seems like a fairly straightforward project.
Even if the addresses weren't hard-coded, you wouldn't be able to change the resources in place because there's still the signed code issue. This configuration is really something that would've had to be designed in there.
#9
Posted 03 January 2013 - 12:57 PM
Looking forward to your finished work and giving it a try. Appreciate it!
Help










