Re: [chrony-users] Question about chrony use in a system without RTC battery

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Hi Bill,

Thanks for the suggestions.

On Thu, Mar 10, 2022 at 6:37 PM Bill Unruh <unruh@xxxxxxxxxxxxxx> wrote:
>
> Why not just use the prodedure that both Miroslav and I suggested-- run a cron
> job once a minute to touch /var/log/chrony.drift. That should be pretty
> reasonable even if the internet went down for a couple of hours before the
> power outage. Most of the computer clocks do pretty well freewheeling, so that
> time should not be too far out  (less than a second and certainly not fast by
> a minute ) for use when chrony comes back up again and the internet comes up
> at powerup so that the count is progressive. I would also make sure that that
> program which dies if the time ever goes backwards  starts up a few minutes
> after chrony comes up again.

Yeah this is what I've implemented. At early boot time (pre-chronyd)
correct the time to last-known-good if the RTC is behind system time
(assuming RTC always falls back). Then, aside from NTP
synchronization, on a regular basis update last-known-good time. I
must say it works quite well.

I did have to fiddle with the "system time provider" in my tool,
because during the lifetime of chronyd, /dev/rtc is unavailable for
reading. So during the early boot time correction I'm using the RTC
from /dev/rtc, then, for runtime last-known-good time updating, I'm
using the system-wide date/time as the system time.

> Note also since your program presumably writes out files, you could use the
> timestamp on those files instead of chrony.drift as the source for you time at
> bootup.

Yes, I'm using the timestamp of a custom file dedicated for this purpose.

Thanks for all the great help!

Met vriendelijke groeten / Kind regards,

Kris van Rens

-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/