[ntp:questions] Finding out where ntpd gets its ntp.conf file

Joseph Gwinn joegwinn at comcast.net
Fri Sep 5 16:43:49 UTC 2008


In article <4357p5-evq.ln1 at gateway.py.meinberg.de>,
 Martin Burnicki <martin.burnicki at meinberg.de> wrote:

> Richard B. Gilbert wrote:
> > ISTR that ntpd looks in /etc/inet if it is not told to look elsewhere by
> > the command that starts ntpd.  This should take care of Unix and
> > Unix-like systems.  Windoze??  Ask someone who knows.
> 
> AFAIK this is the default location under Solaris, but e.g. under Linux the
> location is just /etc. 
> 
> Anyway, this is configured at compile time and maybe overridden by a command
> line parameter, in which case it does not help to know the default.
> 
> On some systems the command line parameters are displayed in the process
> list, so you can:
> 
> 1.) Look at the process list to see if a configuration file has been
> specified
> 
> 2.) If it has not, grep through the ntp binary to find the path of the
> default config file
> 
> 3.) see if that file exists
> 
> Please note that especially under Windows things may look different. The NTP
> service first tries to open %windir%\ntp.conf, and, if that file does not
> exist, %windir%\system32\drivers\etc\ntp.conf.
> 
> The GUI installers provided by Meinberg override these settings with an etc\
> directory below the program installation path, by default \program
> files\ntp\etc. The configured setting can be retrieved from the ImagePath
> registry key of the NTP service registry entry.
> 
> If you are upgrading an installation of NTP under Windows then there may
> still be old config files under the older paths, so you have to look
> explicitely which of the file has being read by the running NTP service.
> 
> If ntpd would write a log message at startup then you could easily find out
> on every platform which config file has been read.

That would certainly work, and work in all cases.

My problem is to debug NTP problems in multiple systems that I have 
limited knowledge of, ones that may or may not follow the usual 
conventions, or the same conventions, and which may in fact may have 
been hosed up by some sysadmin who knows nothing of NTP save where the 
big red start button is supposed to be.

To be useful in such an environment, debug tools must be platform 
independent and cannot make assumptions about conventions being followed.

I am not worried about the case where someone compiles their own munged 
version of NTP.

Joe Gwinn




More information about the questions mailing list