Re: [chrony-users] Question about chrony use in a system without RTC battery |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-users] Question about chrony use in a system without RTC battery
- From: Kris van Rens <kris.van.rens@xxxxxxxxxxx>
- Date: Tue, 29 Mar 2022 17:42:31 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vinotion-nl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=i384VWnp+mg6krrBa16EBAsZJGv5E3hH27jeeRagNFI=; b=p6Y5DSjiXROpHO0nO/JWavPyVrVQloUkV37d/IQFCAKyWNZV1fCrbrK7t4vy0loFNS xblwv8d45inEZQBPQjJubjwfq/uRQ39JEOqdVicULAcwRE0u9EvlAX5bIeCI3HzVsdWP ek0p+b/B6/GLq3pJsHyX0vWIDe7wOcVy0xJPikssCzKBd3GbOwQvDQPYLXTJbsWxlJNe GD8A5/voJ7b2plkf2Yc1X7/tYF5twTpVzwgTgYoMFhF89OL7uCMrfLELkD2jvAkcIkW5 0i2KvxwUtApgliFmVD6bjjvgq7exZx+PdJ7gEd0AEGfIaLmxGEayieqKgTm+utbkFQpo h6Nw==
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.