On Fri 28 Jun 2024 at 11:14:34 (-0500), John Hasler wrote:
> David writes:
> > It's not clear to me which NTP (protocol) packages are set up to use
> > the util-linux stuff, assuming you're not rolling your own
> > startup/shutdown scripts. (That's the problem in the Subject line, in
> > a sense.)
> 
> Chrony can.  I don't know about Ntpsec.  But that doesn't get the
> adjustment made early enough.

By "use the util-linux stuff" I meant use /sbin/hwclock. Neither
chrony nor ntpsec can use hwclock by default as they don't list
util-linux as a dependency. They use their own binaries. IDK whether
you can deliberately configure them to use hwclock instead, or why
any one would do so.

> > The critical part of the whole operation AIUI is not what happens at
> > startup,
> 
> The tricky part, I think, is correcting the rtc before it is used to
> initialize the system time.  Otherwise you'll still have to step or slew
> the system time.
> 
> > but at shutdown: writing to the RTC, and the correct preservation of
> > its state.
> 
> You write to the rtc and to /etc/adjtime periodically at a rate
> determined by the computed hot drift rate and also during a controlled
> shutdown.

With chrony, you can monitor the RTC over time and adjust the system
clock in accordance with its drift rate at boot time, without
correcting the RTC itself, or you can actually set the RTC from the
system clock periodically.

The particular problem at shutdown is that there were/are systems, as
you described, that write the system time to the RTC without
necessarily regarding how you might be running the clock otherwise.
That alteration is unknowable for chrony when it restarts after booting.

Cheers,
David.

Reply via email to