Finding out where ntpd gets its ntp.conf file - NTP

This is a discussion on Finding out where ntpd gets its ntp.conf file - NTP ; Steve Kostecke wrote: > On 2008-09-03, Joseph Gwinn wrote: > >> Read the "service" shell script. It appears to get its file paths from >> environment variables named after the thing being started and stopped >> and accessible only in ...

+ Reply to Thread
Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 40 of 72

Thread: Finding out where ntpd gets its ntp.conf file

  1. Re: Finding out where ntpd gets its ntp.conf file

    Steve Kostecke wrote:
    > On 2008-09-03, Joseph Gwinn wrote:
    >
    >> Read the "service" shell script. It appears to get its file paths from
    >> environment variables named after the thing being started and stopped
    >> and accessible only in the root environment; this bit of RHEL-specific
    >> structure is being chased down. (Does anyone know where this is
    >> documented?)

    >
    > On Linux OSes init scripts are typically found in /etc/init.d/ or
    > /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).
    >

    I believe service is just a front end to those scripts, so I presume
    that, by "service shell scripts" he is referring to those scripts. The
    problem he is having is that they probably source files (bash . command)
    files containing shell variable definitions from the master
    configuration directory, maintained by the, typically GUI, configuration
    tools. I suspect he hasn't realised that is is sourcing thesse files.

    Note that not all Linux distributions use this style of startup script,
    some are based on a more historical style of /etc/rc.

  2. Re: Finding out where ntpd gets its ntp.conf file

    David Woolley writes:

    >Steve Kostecke wrote:
    >> On 2008-09-03, Joseph Gwinn wrote:
    >>
    >>> Read the "service" shell script. It appears to get its file paths from
    >>> environment variables named after the thing being started and stopped
    >>> and accessible only in the root environment; this bit of RHEL-specific
    >>> structure is being chased down. (Does anyone know where this is
    >>> documented?)

    >>
    >> On Linux OSes init scripts are typically found in /etc/init.d/ or
    >> /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).
    >>

    >I believe service is just a front end to those scripts, so I presume


    Yes.

    >that, by "service shell scripts" he is referring to those scripts. The
    >problem he is having is that they probably source files (bash . command)
    >files containing shell variable definitions from the master


    Very rarely. those files tend to be pretty self contained from what I have
    seen with some sourcing of common functions. Since those files are already
    set up by the distrution, there is no need to then put extra stuff into
    some obscure gui file, especially since they are also run from console
    bootup sessions.

    The /etc/init.d/ntpd file is the one taht starts up ntpd. That is where I
    would look first for any weird ntp config file.
    Then if it is not obvious there, look to see if there is some sourceing of
    other files and look in there.

    service runs those files. It does not display them.


    >configuration directory, maintained by the, typically GUI, configuration
    >tools. I suspect he hasn't realised that is is sourcing thesse files.


    >Note that not all Linux distributions use this style of startup script,
    >some are based one a more historical style of /etc/rc.


    Agreed. He said redhat however which does have /etc/init.d/ as the startup
    files. Obviously Windows does not.



  3. Re: Finding out where ntpd gets its ntp.conf file

    On 2008-09-04, David Woolley wrote:
    > Steve Kostecke wrote:
    >> On 2008-09-03, Joseph Gwinn wrote:
    >>
    >>> Read the "service" shell script. It appears to get its file paths from
    >>> environment variables named after the thing being started and stopped
    >>> and accessible only in the root environment; this bit of RHEL-specific
    >>> structure is being chased down. (Does anyone know where this is
    >>> documented?)

    >>
    >> On Linux OSes init scripts are typically found in /etc/init.d/ or
    >> /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).
    >>

    > I believe service is just a front end to those scripts, so I presume
    > that, by "service shell scripts" he is referring to those scripts.
    > The problem he is having is that they probably source files (bash
    > . command) files containing shell variable definitions from the
    > master configuration directory, maintained by the, typically GUI,
    > configuration tools. I suspect he hasn't realised that is is sourcing
    > thesse files.


    And your point is?

    It is highly likely that the OP has not bothered to grep the /etc/
    directory for instances of 'ntp.conf'.

    That _one_ simple act would render this entire discussion moot because
    it would clearly the ntp.conf file being passed to ntpd.

    --
    Steve Kostecke
    NTP Public Services Project - http://support.ntp.org/

  4. Re: Finding out where ntpd gets its ntp.conf file

    Unruh wrote:

    > Very rarely. those files tend to be pretty self contained from what I have
    > seen with some sourcing of common functions. Since those files are already
    > set up by the distrution, there is no need to then put extra stuff into
    > some obscure gui file, especially since they are also run from console
    > bootup sessions.


    GUI was a read herring. The files I am thinking of, on Red Hat, are in
    a directory called, something like, /etc/sysconfig. They generally
    contain all the variable parameters. Whether or not they contain the
    ntpd configuration file name would depend on whether the GUI tools make
    that a user configurable option.

    Incidentally, Red Hat can and do change the location of files to reflect
    their filesystem layout policies.

    I don't have access to a Red Hat system immediately. Slackware uses
    /etc/ntp.conf, but doesn't use the System V (?) style start up scripts.

  5. Re: Finding out where ntpd gets its ntp.conf file

    Steve Kostecke wrote:
    >
    > And your point is?


    My point is that there was reasonable grounds to believe that the OP had
    actually looked inside /etc/inet.d/ntpd, but you were telling him how to
    find it.

    >
    > It is highly likely that the OP has not bothered to grep the /etc/
    > directory for instances of 'ntp.conf'.


    He was already aware of /etc/ntp.conf, but assures us that it isn't
    actually used by the ntpd in question.

    >
    > That _one_ simple act would render this entire discussion moot because
    > it would clearly the ntp.conf file being passed to ntpd.


    I believe he has already established that it is not.

    > > [peterc@tantalus ~]$ strings /usr/sbin/ntpd|grep ntp.conf
    > > > /etc/ntp.conf


    > In the RHEL case, this would find exactly the wrong copy of ntp.conf,
    > being the one we were changing to no avail, not the one that NTP was in
    > fact using.


    Unfortunately I don't have access to a copy of RHEL and don't even have
    access to earlier versions, at home, without formatting up a partition
    and installing it, so I can't confirm what he is reporting and I'm
    having to rely on my memory of how the start up scripts work.

    Typical things that might be done are:

    - using the /var tree (7 Google hits for /var/etc/ntp.conf;
    - using a sub-directory of /etc (582 for /etc/ntp/ntp.conf; 4 for
    /etc/sysconfig/ntpd.conf; 75 for /etc/config/ntp.conf);
    - name variations (3420 /etc/ntpd.conf)
    - using a chroot environment (186 for chrooted ntpd, rather more for
    chroot AND ntpd, although there isn't a simple test for filenames;
    - linking to /opt, with automatic "repair" of the link (SCO Openserver
    will soft link /opt, but I don't think it would automatically repair).

    Even if they are not done for RHEL, he is using multiple systems, and
    they may well be done for some of them.


    >


  6. Re: Finding out where ntpd gets its ntp.conf file

    Steve Kostecke writes:

    >On 2008-09-04, David Woolley wrote:
    >> Steve Kostecke wrote:
    >>> On 2008-09-03, Joseph Gwinn wrote:
    >>>
    >>>> Read the "service" shell script. It appears to get its file paths from
    >>>> environment variables named after the thing being started and stopped
    >>>> and accessible only in the root environment; this bit of RHEL-specific
    >>>> structure is being chased down. (Does anyone know where this is
    >>>> documented?)
    >>>
    >>> On Linux OSes init scripts are typically found in /etc/init.d/ or
    >>> /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).
    >>>

    >> I believe service is just a front end to those scripts, so I presume
    >> that, by "service shell scripts" he is referring to those scripts.
    >> The problem he is having is that they probably source files (bash
    >> . command) files containing shell variable definitions from the
    >> master configuration directory, maintained by the, typically GUI,
    >> configuration tools. I suspect he hasn't realised that is is sourcing
    >> thesse files.


    >And your point is?


    >It is highly likely that the OP has not bothered to grep the /etc/
    >directory for instances of 'ntp.conf'.


    >That _one_ simple act would render this entire discussion moot because
    >it would clearly the ntp.conf file being passed to ntpd.


    His point was that it was possible that a) the conf file was not called
    ntp.conf, and b) that it was not in /etc/init.d/ntpd because it was in some
    gui config file instead which was sourced by /etc/init.d/ntpd and c) that
    perhaps the OP had a distro which does not use /etc/init.d
    All those are possible, but I agree that the first thing to do is to look
    at /etc/init.d/ntpd ( which exists on redhat, but certainly not on windows)
    and then go on from there.


  7. Re: Finding out where ntpd gets its ntp.conf file

    David Woolley writes:

    >Steve Kostecke wrote:
    >>
    >> And your point is?


    >My point is that there was reasonable grounds to believe that the OP had
    >actually looked inside /etc/inet.d/ntpd, but you were telling him how to
    >find it.


    >>
    >> It is highly likely that the OP has not bothered to grep the /etc/
    >> directory for instances of 'ntp.conf'.


    >He was already aware of /etc/ntp.conf, but assures us that it isn't
    >actually used by the ntpd in question.


    Boy, I feel like a translation service. I think he meant the files in
    /etc/init.d .Ie
    grep ntp.conf /etc/init.d/*


    >>
    >> That _one_ simple act would render this entire discussion moot because
    >> it would clearly the ntp.conf file being passed to ntpd.


    >I believe he has already established that it is not.


    It might show that that file is /usr/lib/ntp.conf
    (for some reason some distros like putting config stuff into a lib
    directory. )


    > > > [peterc@tantalus ~]$ strings /usr/sbin/ntpd|grep ntp.conf
    > > > > /etc/ntp.conf


    > > In the RHEL case, this would find exactly the wrong copy of ntp.conf,
    > > being the one we were changing to no avail, not the one that NTP was in
    > > fact using.


    This would tell you what the default location was. REdhat might have
    changed it to something else. and doing that would show you. Is it not
    easier just to try the command and see what it produces than post here that
    the results might not be usefull without trying it?



    >Unfortunately I don't have access to a copy of RHEL and don't even have
    >access to earlier versions, at home, without formatting up a partition
    >and installing it, so I can't confirm what he is reporting and I'm
    >having to rely on my memory of how the start up scripts work.


    >Typical things that might be done are:


    >- using the /var tree (7 Google hits for /var/etc/ntp.conf;
    >- using a sub-directory of /etc (582 for /etc/ntp/ntp.conf; 4 for
    >/etc/sysconfig/ntpd.conf; 75 for /etc/config/ntp.conf);
    >- name variations (3420 /etc/ntpd.conf)
    >- using a chroot environment (186 for chrooted ntpd, rather more for
    >chroot AND ntpd, although there isn't a simple test for filenames;
    >- linking to /opt, with automatic "repair" of the link (SCO Openserver
    >will soft link /opt, but I don't think it would automatically repair).


    >Even if they are not done for RHEL, he is using multiple systems, and
    >they may well be done for some of them.


    Agreed. So I would first do the strings....|grep route, maybe seraching
    just for conf instead of ntp.conf.
    Then I would look in /etc/init.d/ntpd

    Then when none of those produced anything helpful I would come back here
    and ask for further help.





    >>


  8. Re: Finding out where ntpd gets its ntp.conf file

    Steve Kostecke wrote:

    > On 2008-09-04, Peter J. Cherny wrote:
    >
    >> In most OSs the man pages are definitive and mostly correct,

    >
    > Any NTP documentation distributed as man pages is produced by third
    > parties and should not be viewed as authoritative.


    Hm, the current repos (both -dev and -stable) contain a .1 file for every
    binary which seems to be some kind of template to generate at least a man
    page ...

    Martin
    --
    Martin Burnicki

    Meinberg Funkuhren
    Bad Pyrmont
    Germany

  9. Re: Finding out where ntpd gets its ntp.conf file

    Richard,

    Richard B. Gilbert wrote:
    > Since the source to NTPD is available, it's a SMOP to modify it to print
    > out the desired file specification!


    AFAIR the original questino was how to find out which config file the
    existing ntpd is using, e.g. if you're asked to have a look at a system
    which you have not set up.

    If you recompile and install the daemon you should anyway know what you have
    done.

    Martin
    --
    Martin Burnicki

    Meinberg Funkuhren
    Bad Pyrmont
    Germany

  10. Re: Finding out where ntpd gets its ntp.conf file

    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.

    Martin
    --
    Martin Burnicki

    Meinberg Funkuhren
    Bad Pyrmont
    Germany

  11. Re: Finding out where ntpd gets its ntp.conf file

    Unruh wrote:
    > Joseph Gwinn writes:
    >>In this case, none of the sysadmins (who are too busy) had any idea what
    >>was going on, and they didn't know enough about NTP to realize what was
    >>going on. The sysadmin had gotten the can't-sync error message many
    >>times, but didn't quite understand what it was saying. So even if he is
    >>hit by an irate truck, his replacement won't necessarily be better or
    >>worse.

    >
    >>The problem I'm trying to solve is different. We put NTP on lots of
    >>different kinds of computer, mostly Unix, but some Windows, and I'm
    >>looking for diagnosis tools that will tell me what's really going on,
    >>precisely so I can debug unfamiliar setups no matter how screwed up.

    >
    > You cannot. They can screw up so badly that it is impossible to
    > disentangle. For all you know they rewrote ntp to only use their server.
    >
    > The only sure way is to recompile ntpd from the original source yourself
    > for each machine. They you know what the defaults are.


    It's easy to find the defaults. The problem arises if someone has configured
    ntpd *not* to use the defaults.

    For example, if ntpd runs in a chroot jail, even if it uses the default
    configuration file the behaviour depends on whether the startup script
    copies the ntp.conf file to the jail (SuSE/openSUSE Linux) or if there is
    one config file at the default location and another config file below the
    jail dir.

    Since ntpd would not detect (AFAIK) that it runs in a jail dir it would even
    print the config file path below the jail dir, so the admin needs to check
    whether ntpd runs chrooted or not to find out whether the original config
    file or the config file below the jail dir has been used.

    Martin
    --
    Martin Burnicki

    Meinberg Funkuhren
    Bad Pyrmont
    Germany

  12. Re: Finding out where ntpd gets its ntp.conf file

    Unruh wrote:

    > I seriously doubt that redhat would recompile ntpd and put in a different
    > default config file.
    >


    Why not? The Solaris version certainly does. It uses
    /etc/inet/ntp.conf by default.

    Brian Utterback

  13. Re: Finding out where ntpd gets its ntp.conf file

    In article ,
    Unruh wrote:

    > Joseph Gwinn writes:
    >
    > >In article <48bf5d9c$0$21355$c30e37c6@pit-reader.telstra.net>,
    > > "Peter J. Cherny" wrote:

    >
    > >> Joseph Gwinn wrote:
    > >> >...
    > >> > Which brings me to a question: How does one get NTP to tell you exactly
    > >> > where it is getting such things as the ntp.conf file from, all without
    > >> >...
    > >> [peterc@tantalus ~]$ strings /usr/sbin/ntpd|grep ntp.conf
    > >> /etc/ntp.conf

    >
    > >In the RHEL case, this would find exactly the wrong copy of ntp.conf,
    > >being the one we were changing to no avail, not the one that NTP was in
    > >fact using.

    >
    > Which one was ntp in fact using?


    Don't know yet. Other than it wasn't the obvious one.

    When we do figure it out, all pretenders to the throne will be summarily
    deleted, to prevent confusion.


    > >> [peterc@tantalus ~]$ strace -f -o x /usr/sbin/ntpd -g

    >
    > >I'll have to look into this. It sounds like it might be general enough.

    >
    > >
    > >> [root@tantalus ~]# grep ntp.conf x
    > >> 3351 open("/etc/ntp.conf", O_RDONLY) = 4

    >
    > >Doesn't this assume that the correct "ntp.conf" file is called ntp.conf?
    > >It may be common, the standard convention, but it is not required.

    >
    > >The whole point is to find the correct file without making assumptions,
    > >because on a strange computer strange things may have been done.

    >
    > yes, but then do strace as above and look through the file looking for
    > something that might be a configuration file. If they call it /lib/libc.so
    > then you are probably **** out of luck, but usually they will not do that.


    The strace gave a lot of data, mostly irrelevant, which I will plow
    through next week.

    Joe Gwinn

  14. Re: Finding out where ntpd gets its ntp.conf file

    In article ,
    Steve Kostecke wrote:

    > On 2008-09-03, Joseph Gwinn wrote:
    >
    > > Read the "service" shell script. It appears to get its file paths from
    > > environment variables named after the thing being started and stopped
    > > and accessible only in the root environment; this bit of RHEL-specific
    > > structure is being chased down. (Does anyone know where this is
    > > documented?)

    >
    > On Linux OSes init scripts are typically found in /etc/init.d/ or
    > /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).


    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.


    > > Which brings me to a question: How does one get NTP to tell you exactly
    > > where it is getting such things as the ntp.conf file from, all without
    > > being able to find or see the actual command line or lines that launched
    > > the daemon? I did not see a ntpq command that sounded plausible,
    > > although ntpq would be an obvious choice.
    > >
    > > This would be very useful for debugging, as each and every platform type
    > > seems to have a different approach to handling NTP.

    >
    > Why not use the file location features built in to your OS to find all
    > possible instances of ntp.conf?
    >
    > $ locate ntp.conf
    >
    > or
    >
    > $ find / -name ntp.conf
    >
    > Pipe the output of either of those commands to 'xargs ls -l' to see the
    > datestamps of the files.


    We did this, but could not tell which one mattered. Next week.

    Nor is it *required* the the ntp configuration file be called ntp.config.


    Joe Gwinn

  15. Re: Finding out where ntpd gets its ntp.conf file

    In article <48c04a8e$0$518$5a6aecb4@news.aaisp.net.uk>,
    David Woolley wrote:

    > Steve Kostecke wrote:
    > > On 2008-09-03, Joseph Gwinn wrote:
    > >
    > >> Read the "service" shell script. It appears to get its file paths from
    > >> environment variables named after the thing being started and stopped
    > >> and accessible only in the root environment; this bit of RHEL-specific
    > >> structure is being chased down. (Does anyone know where this is
    > >> documented?)

    > >
    > > On Linux OSes init scripts are typically found in /etc/init.d/ or
    > > /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).
    > >

    > I believe service is just a front end to those scripts, so I presume
    > that, by "service shell scripts" he is referring to those scripts. The
    > problem he is having is that they probably source files (bash . command)
    > files containing shell variable definitions from the master
    > configuration directory, maintained by the, typically GUI, configuration
    > tools. I suspect he hasn't realised that is is sourcing thesse files.


    Ahh. I had figured out the first part of this, but had not figured out
    where the data was kept. Environment variables didn't have anything
    plausible. But it has to come from *somewhere*.

    The sysadmins know nothing of all this, being AIX and Solaris guys.


    > Note that not all Linux distributions use this style of startup script,
    > some are based on a more historical style of /etc/rc.


    Natch. That's why ntpq needs a bit more built-in debug support.

    Joe Gwinn

  16. Re: Finding out where ntpd gets its ntp.conf file

    In article ,
    "Richard B. Gilbert" wrote:

    > Joseph Gwinn wrote:
    > > In article <30s4p5-as9.ln1@gateway.py.meinberg.de>,
    > > Martin Burnicki wrote:
    > >
    > >> Joe,
    > >>
    > >> Joseph Gwinn wrote:
    > >>> In article <48bf5d9c$0$21355$c30e37c6@pit-reader.telstra.net>,
    > >>> "Peter J. Cherny" wrote:
    > >>>
    > >>>> Joseph Gwinn wrote:
    > >>>>> ...
    > >>>>> Which brings me to a question: How does one get NTP to tell you
    > >>>>> exactly where it is getting such things as the ntp.conf file from, all
    > >>>>> without
    > >>>> >...
    > >>>> [peterc@tantalus ~]$ strings /usr/sbin/ntpd|grep ntp.conf
    > >>>> /etc/ntp.conf
    > >>> In the RHEL case, this would find exactly the wrong copy of ntp.conf,
    > >>> being the one we were changing to no avail, not the one that NTP was in
    > >>> fact using.
    > >>>
    > >>>
    > >>>> [peterc@tantalus ~]$ strace -f -o x /usr/sbin/ntpd -g
    > >>> I'll have to look into this. It sounds like it might be general enough.
    > >>>
    > >>>
    > >>>> [root@tantalus ~]# grep ntp.conf x
    > >>>> 3351 open("/etc/ntp.conf", O_RDONLY) = 4
    > >>> Doesn't this assume that the correct "ntp.conf" file is called ntp.conf?
    > >>> It may be common, the standard convention, but it is not required.
    > >>>
    > >>> The whole point is to find the correct file without making assumptions,
    > >>> because on a strange computer strange things may have been done.
    > >> I fully agree.
    > >>
    > >> Ntpd generates a bunch of messages about what it has found in the config
    > >> file, at least in debug mode.
    > >>
    > >> Maybe you should open an enhancement request on http://bugs.ntp.org to make
    > >> ntpd also print the name of the config file it is using, maybe only in
    > >> debug mode.

    > >
    > > I'm surprised that it doesn't already print the full filename of every
    > > file it uses.
    > >
    > > Will debug mode do much if the binary wasn't compiled for debug? I'm
    > > trying to use the provided binary, whatever it might be, and recompiling
    > > is usually far too much trouble to be practical. Especially as the
    > > effort is per platform type, and we have multiple types.
    > >
    > > I will file an enhancement request. However, my feeling is that this
    > > function would be most useful if added to ntpq, and yielded the full
    > > filename including directories, as there may be multiple "ntp.conf"
    > > files scattered about. The key is to get NTP to tell us which file NTP
    > > is using, without interference from our firmly held but sadly mistaken
    > > assumptions about what NTP ought to be doing.
    > >
    > > Joe Gwinn

    >
    > Since the source to NTPD is available, it's a SMOP to modify it to print
    > out the desired file specification!


    True enough, but far too much work.

    Joe Gwinn

  17. Re: Finding out where ntpd gets its ntp.conf file

    In article <4357p5-evq.ln1@gateway.py.meinberg.de>,
    Martin Burnicki 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

  18. Re: Finding out where ntpd gets its ntp.conf file

    In article <48bfe483$0$21371$c30e37c6@pit-reader.telstra.net>,
    "Peter J. Cherny" wrote:

    > Joseph Gwinn wrote:
    > > I will file an enhancement request. However, my feeling is that this
    > > function would be most useful if added to ntpq, and yielded the full
    > > filename including directories, as there may be multiple "ntp.conf"
    > > files scattered about. The key is to get NTP to tell us which file NTP
    > > is using, without interference from our firmly held but sadly mistaken
    > > assumptions about what NTP ought to be doing.

    >
    > And you'll file enhancement requests for every other daemon
    > on the machine ???


    Only the ones that sufficiently annoy me.


    > In most OSs the man pages are definitive and mostly correct,
    > with changes noted in the release notes.
    > If you've paid your support fees, ask the vendor.
    > In most of the Unix family, the source is available.


    A support question is being placed with IBM.

    But newsgroups often think of angles that support does not.


    >
    > Else, ask a SysAdmin/SysEngineer/SwEngineer who does this for a living.
    > You do have other than junior staff ?
    >


    Umm. I'm not a sysadmin. If we had such a person, I wouldn't be doing
    the debugging. Few people even know that NTP exists, let alone how it
    works well enough to debug an installation. When there is a time
    problem, the sysadmins come and grab me to help them. So far, I've
    always been able to figure the problem out.

    Joe Gwinn

  19. Re: Finding out where ntpd gets its ntp.conf file

    Joseph Gwinn wrote:
    > We had been struggling with NTP running on Red Hat Enterprise Linux
    > (RHEL) on IBM-built Intel boxes, specifically with getting NTP to
    > generate loopstats and peerstats files. Basically, nothing worked,
    > despite many attempts.


    imho the most general solution to this problem is using strace.

    you can either run a command under strace:
    strace -e trace=open,close -o mylogname.log -f ntpd

    or attach to a running process.
    strace -p $PID

    additionally you can see all open files of a process
    in /proc/$PID/fd/*

    uwe

  20. Re: Finding out where ntpd gets its ntp.conf file

    Joseph Gwinn wrote:
    > In article ,
    > Steve Kostecke wrote:
    >
    >> On 2008-09-03, Joseph Gwinn wrote:
    >>
    >>> Read the "service" shell script. It appears to get its file paths from
    >>> environment variables named after the thing being started and stopped
    >>> and accessible only in the root environment; this bit of RHEL-specific
    >>> structure is being chased down. (Does anyone know where this is
    >>> documented?)

    >> On Linux OSes init scripts are typically found in /etc/init.d/ or
    >> /etc/rc.d/init.d/ Look for one named ntp (or something containing ntp).

    >
    > 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.
    >
    >
    >>> Which brings me to a question: How does one get NTP to tell you exactly
    >>> where it is getting such things as the ntp.conf file from, all without
    >>> being able to find or see the actual command line or lines that launched
    >>> the daemon? I did not see a ntpq command that sounded plausible,
    >>> although ntpq would be an obvious choice.
    >>>
    >>> This would be very useful for debugging, as each and every platform type
    >>> seems to have a different approach to handling NTP.

    >> Why not use the file location features built in to your OS to find all
    >> possible instances of ntp.conf?
    >>
    >> $ locate ntp.conf
    >>
    >> or
    >>
    >> $ find / -name ntp.conf
    >>
    >> Pipe the output of either of those commands to 'xargs ls -l' to see the
    >> datestamps of the files.

    >
    > We did this, but could not tell which one mattered. Next week.
    >
    > Nor is it *required* the the ntp configuration file be called ntp.config.
    >
    >
    > Joe Gwinn


    There MIGHT, in rare cases, be good reason NOT to call the configuration
    file "ntp.conf" (it's conf not config, unless someone changed it
    recently). IF so, both the new name and the reasons for it should be
    documented! In most cases it's best to stick with the de facto standard.

+ Reply to Thread
Page 2 of 4 FirstFirst 1 2 3 4 LastLast