[G4] Network Time

Perry The Cynic perry at cynic.org
Mon Sep 22 21:09:54 PDT 2003


--On Monday, September 22, 2003 7:35 AM -0400 Pastor Mac 
<pastormac at macmail.com> wrote:

> I've noticed in the Jaguar Date/Time CP that the ntp (Network Time)
> preferences seemingly do not allow adding servers nor adjust how often a
> server is queried.  Can these things still be changed? How--via a cron
> job?  How would a script be written for such?
>
> Pax,
>
> Pastor Mac
> On OS X


Ah. Things are much cooler than you suspect. :-)

If you can't seem to type a server name into the "NTP Server:" field, you 
probably didn't log in as an administrator. Click on the little padlock 
icon in the lower left corner of the window and type an administrator 
password. The field will unlock and let you type into it.

In fact, you can type several server names separated with spaces, and the 
server will try them all simultaneously and automatically pick a "good" one 
to synchronize against. That's particularly nice if you have a powerbook 
that moves around networks that are hemmed in by firewalls.

That's not the cool part yet. Rather than the old "check every so often and 
fix the clock" way, OS X runs a genuine NTP daemon (called "ntpd", of 
course). The daemon talks to all listed time servers, determines how often 
it needs to do so, picks a "good" one to synchronize with, and switches to 
another if the current one goes bad. That's why you can't set a time 
interval; the process is self-regulating (for minimum network traffic).

Finally, if you really want to mess with the details of the NTP protocol, 
you should know that what you type into the "NTP Server:" field actually 
ends up in the file /etc/ntp.conf, which is a bog-standard ntpd 
configuration file that you can hack to your heart's (and abilities') 
content. If you do this, don't type into the preferences panel, or it will 
wipe out your custom edits. (If you have no idea what to put into that 
file, you probably don't want to. :-)

And for a final, ultra-geeky thrill, open up Terminal and type "ntpdc". 
This is the (UNIX standard) ntpd control program, which can tell you in 
excruciating detail how your time server is doing. Try the "sysinfo" and 
"peers" commands.

Cheers
  -- perry
---------------------------------------------------------------------------
Perry The Cynic                                             perry at cynic.org
To a blind optimist, an optimistic realist must seem like an Accursed Cynic.
---------------------------------------------------------------------------



More information about the G4 mailing list