Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #270541

Re: How to use /etc/adjtime

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: How to use /etc/adjtime
Date 2024-06-28 16:10 +0200
Message-ID <IUksx-6dVD-3@gated-at.bofh.it> (permalink)
References <IU0tP-6166-1@gated-at.bofh.it> <IU9x7-679N-1@gated-at.bofh.it> <IUk9b-6dzT-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jun 28, 2024 at 09:48:12 -0400, Stefan Monnier wrote:
> Oh, indeed, thanks.  I had computed it manually from
> `journalctl | grep stepped` and it gave close enough results.
> The question remains: how to make use of that info upon wakeup to adjust
> the "initial" time before NTP takes over.

As I understand it, the drift is used to speed up or slow down the
system clock, so that it more closely tracks real time, and needs
fewer nudges by NTP.

As such, it really has nothing to do with how the system clock is
initialized at boot time (or wake-from-suspend time? I don't do laptops).

At boot time, the system clock is initialized by reading the hardware
clock, with the assumptions that the hardware clock is not very
accurate, but is better than nothing.  The system clock will be
adjusted by NTP once the network is up and once the NTP daemon has had
a chance to communicate with its servers and figure out what time it
actually is.

> Indeed, I could try and shorten the time before the NTP info takes
> precedence over the RTC-derived initial approximation (I haven't found
> any way to tell ntpsec to do that, short of limiting the maximum
> interval between pollings or maybe killing&restarting the deamon, both
> of which seem too crude for my sense of aesthetics), but I'm more
> interested in improving the initial approximation.

I'm failing to understand your thought process here.

The hardware clock has a time, which is loaded into the system clock
to initialize it.  That's it.  The only variable factor here is whether
the hardware clock's time is in UTC or some local time zone.

You can't do anything with drift at this point, because you don't actually
know how long you were asleep.  All you know is the current HW clock time.
It's not like you can say "Oh, I was asleep for 7.5234 hours, so I need
to adjust the HW clock time forward by X seconds because I know it runs
a bit slow."  That information is not available to you.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-27 18:50 +0200
  Re: How to use /etc/adjtime <tomas@tuxteam.de> - 2024-06-27 19:10 +0200
    Re: How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-28 15:50 +0200
  Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-28 04:30 +0200
    Re: How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-28 15:50 +0200
      Re: How to use /etc/adjtime Greg Wooledge <greg@wooledge.org> - 2024-06-28 16:10 +0200
        Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-28 16:40 +0200
        Re: How to use /etc/adjtime John Hasler <john@sugarbit.com> - 2024-06-28 16:50 +0200
          Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-28 17:10 +0200
            Re: How to use /etc/adjtime John Hasler <john@sugarbit.com> - 2024-06-28 18:20 +0200
              Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-28 21:10 +0200
                Re: How to use /etc/adjtime John Hasler <john@sugarbit.com> - 2024-06-28 22:10 +0200
                Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-30 06:50 +0200
                Re: How to use /etc/adjtime <tomas@tuxteam.de> - 2024-06-29 07:00 +0200
                Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-30 06:50 +0200
          Re: How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-28 20:50 +0200
            Re: How to use /etc/adjtime Max Nikulin <manikulin@gmail.com> - 2024-06-29 03:30 +0200
        Re: How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-28 20:40 +0200
          Re: How to use /etc/adjtime Greg Wooledge <greg@wooledge.org> - 2024-06-28 21:00 +0200
            Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-28 21:50 +0200
            Re: How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-28 22:00 +0200
              Re: How to use /etc/adjtime Greg Wooledge <greg@wooledge.org> - 2024-06-28 22:30 +0200
                Re: How to use /etc/adjtime Stefan Monnier <monnier@iro.umontreal.ca> - 2024-06-28 23:10 +0200
                Re: How to use /etc/adjtime David Wright <deblis@lionunicorn.co.uk> - 2024-06-29 02:10 +0200
  Re: How to use /etc/adjtime Charles Curley <charlescurley@charlescurley.com> - 2024-06-29 06:00 +0200
    Re: How to use /etc/adjtime Charles Curley <charlescurley@charlescurley.com> - 2024-06-29 18:50 +0200

csiph-web