• ntpd keeps calling adjtime when synchronized to local clock

    From rcheaito via questions Mailing List@[email protected] to questions on Mon Nov 3 22:43:00 2025
    From Newsgroup: comp.protocols.time.ntp

    When ntpd is running with the following simple config:

    restrict 127.0.0.1
    server 127.127.1.0

    is it expected that ntpd keeps calling adjtime()?

    My understanding is that in this config type, ntpd runs as server only, and will sync itself to the local clock driver. So, if I am not missing something, the daemon should not try to adjust the local clock that it is synchronizing to.

    Is this a specific behavior with VxWorks (where I am testing ntpd with), or common to all systems?


    0x01d67ad0 ntpdmain +0x6c0: timer ()
    0x01d85968 timer +0x58 : 0x01d7156c ()
    0x01d71698 adj_host_clock+0x164: adj_systime ()
    0x0092eca0 adj_systime +0x254: adjtime ()

    Thanks

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From David Woolley@[email protected] to comp.protocols.time.ntp on Mon Nov 3 23:36:53 2025
    From Newsgroup: comp.protocols.time.ntp

    On 03/11/2025 22:43, rcheaito via questions Mailing List wrote:
    My understanding is that in this config type, ntpd runs as server only, and will sync itself to the local clock driver. So, if I am not missing something,
    the daemon should not try to adjust the local clock that it is synchronizing to.

    It will report a finite stratum, and the frequency and phase adjusted
    system time. Unless the kernel API allows direct setting of the time
    (and if it is using adjtime, rather than adjtimex, that suggest the
    kernel doesn't allow control of the frequency), it will need to
    continuously nudge the kernel time, to keep the effective average
    frequency at the value it was set to before it lost all upstream
    sources, in the same way as it was being controlled when the upstream
    sources were valid.

    What you appear to be suggesting would result in the frequency reverting
    to the one determined by the crystal, but ntpd knows the error in that frequency, immediately before the outage, so can and does correct for
    that error.

    The ntpd time for a machine is always the corrected local time for that machine, so there is no resynchronisation process. What actually
    happens is a change in the metadata.

    Using the local clock pseudo-driver has been superceded by orphan mode,
    as the preferred way of handling this situation.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From David Woolley@[email protected] to comp.protocols.time.ntp on Mon Nov 3 23:37:57 2025
    From Newsgroup: comp.protocols.time.ntp

    On 03/11/2025 23:36, David Woolley wrote:
    allows direct setting of the time

    That should have said "of the frequency".
    --- Synchronet 3.21a-Linux NewsLink 1.2