Re: ntp woes (and more-general questions about startup and logging)
- From: "P. Sture" <paul.nospam@xxxxxxxx>
- Date: Mon, 12 Oct 2009 18:36:08 +0200
In article <7jbgtvF32cebjU2@xxxxxxxxxxxxxxxxxx>,
blmblm@xxxxxxxxxxxxx <blmblm@xxxxxxxxxxxxx> wrote:
(Aside: I'm used to dialogs that include an "apply" or "save
changes" button somewhere, and the one for changing date/time
settings didn't seem to have that. Is that how things work
on Macs? Do changes go into effect when you click an option,
or when you close the window, or what?)
Thanks for raising that question. I too am used to "apply" and "save"
buttons on other systems, and have wondered this myself.
I just tried disabling "Set date and time automatically" in the
date/time dialog, then re-enabling it. The TIMESYNC=-YES- line in
/etc/hostconfig was changed to -NO- immediately when I unchecked the
box, and back to -YES- immediately when I checked it.
I tested this on both 10.4.11 and 10.5.8.
(I note that at the beginning of /etc/hostconfig for 10.5.8 there is an
extra line:
# This file is going away
and assume that applies to some future release (I don't have 10.6 here).)
Thinking about it, the services in the System Preferences "Sharing" pane
also react immediately to a check box click.
In contrast the dialogs in System Preference "Network" do have "Apply"
or OK/Cancel buttons.
I then used that "go to server" thing to log into one of the
headless 10.4 machines and ran the GUI tool for configuring
date/time settings. It did *something*, since I observed
that after I ran it the ntpd process had been restarted, and
/etc/ntp.conf had been modified, but ntpq and ntpdc were still
showing status information that seemed wrong (no "*" at the
start of the output of "peers", indicating -- to me anyway --
no communication with the designated server). I tried pointing
the 10.4 machine both at the local server and at Apple's server,
but both gave the same wrong-seeming results.
I am seeing the same on my 10.4 system, and suspect it hasn't worked for
a while. The disabling and enabling I did above has brought it back to
the correct time (it was about 40 seconds fast), but there's no "*"
displayed here either.
And now we come to the part that has me baffled: I checked status
again the next day on all the machines I'd been using in these
experiments, and .... All but one of the headless servers (10.4)
appeared to be communicating with our local time server, if one
can believe the output of ntpq and ntpdc. I restarted ntpd from
the command line once more on the machine that apparently wasn't
communicating with the local server, observed that ntpq/ntpdc
still reported "not communicating", started writing this post,
checked again, and -- found that all was well.
OK, I'm going to wait until tomorrow and check my 10.4 system again.
One thing which may be pertinent to the problem is that my 10.4 system
originally started out life running previous versions of OS X. I took
it to 10.3 with upgrades, then with 10.4 did a fresh installation _but_
used Migration Assistant to pull my networking set up over.
Perhaps there's hidden cruft somewhere. Did all your 10.4 systems start
out life at 10.4 or were just some of them upgraded from previous
versions?
It's a mystery. I'd suspect that something has changed on the
local time server, except that the ntpd process there hasn't been
restarted in weeks. Maybe the trick is to restart ntpd and then
wait a bit before checking status??
But at least I (think I) know how to restart ntpd from the
command line .... For the record (and welcoming corrections),
it appears that on the 10.4 machines the following works:
ls /System/Library/StartupItems/NetworkTime/NetworkTime restart
while on the 10.5 machines -- well, I'm not 100% sure, but
it appears that the preferred method is to use the command
"launchctl", and the following seems to work
launchctl stop org.ntp.ntpd
though it's not clear it's the best approach (maybe "unload" and
"load" would be better, but I can't figure out what parameters
to give them). And yes, "stop" is counterintuitive here for
a restart, but the thing seems to be set up to automatically
restart when stopped.
The "load" and "unload" subcommands take a file (or directory) name, so
if you don't know that it could be tricky :-)
On 10.5 that's /System/Library/LaunchDaemons/org.ntp.ntpd.plist
On 10.4 I cannot find any plist with "ntp" in the name.
The 10.5 man entry for launchctl is much more comprehensive than the one
on 10.4.
--
Paul Sture
.
- Follow-Ups:
- References:
- ntp woes (and more-general questions about startup and logging)
- From: blmblm
- Re: ntp woes (and more-general questions about startup and logging)
- From: P. Sture
- Re: ntp woes (and more-general questions about startup and logging)
- From: blmblm
- Re: ntp woes (and more-general questions about startup and logging)
- From: blmblm
- Re: ntp woes (and more-general questions about startup and logging)
- From: blmblm
- ntp woes (and more-general questions about startup and logging)
- Prev by Date: Re: "Contents" folders
- Next by Date: Re: Where have all the filers gone?
- Previous by thread: Re: ntp woes (and more-general questions about startup and logging)
- Next by thread: Re: ntp woes (and more-general questions about startup and logging)
- Index(es):
Relevant Pages
|