[ntp:questions] Finding out where ntpd gets its ntp.conf file
hal-usenet at ip-64-139-1-69.sjc.megapath.net
Tue Sep 9 07:28:01 UTC 2008
>Yes, and that's where strace led me, where I found a script called ntpd.
>How the service script interacts with this ntpd script isn't clear.
>Environment variables seem to be implicated, but a listing of
>environment variables is not helpful. Next week I'll digest it all.
I think there are two parts to this discussion. One is how to debug
this particular problem. The other is how to make ntpd easier to
[I'm using a really really old RH and Fedora 7.]
service ntpd start just runs /etc/init.d/ntpd start
/etc/init.d/ntpd is just a script. You can debug it
just like you debug any other script.
if [ -f /etc/sysconfig/ntpd ];then
I think the last line is misleading. I think it's leftover
from when it used to be normal to use ntpdate and it was
getting the servers for ntpdate out of the ntpd config file.
I seem to remember hacking my startup stuff to include
a few printfs/echos when I was debugging something.
A quick check in your /etc/sysconfig/ntpd might be interesting.
There are two things that might add to the confusion in this area.
RH (and many other distributions) used to have their own copy
of the sources that was patched so they could run ntpd as non-root.
That makes it easier to add other patches. Who knows what they
Some systems use a chroot jail. I don't know much about them,
but I wouldn't be surprised if that used the wrong ntp.conf.
I agree that it might have made your debugging easier if
ntpd had logged the exact answer to your question. On
the other hand, most of the time that would just be clutter.
ntpd has a switch on the command line that generates
a lot of debugging printout. I haven't used it in a while.
I think you have to run ntpd from a terminal without going
into deamon mode.
It might be helpful to have a command line switch that would
log all the "interesting" stuff that was needed for debugging
These are my opinions, not necessarily my employer's. I hate spam.
More information about the questions