[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Running chrony and rtc



* Bill Moseley (moseley@hank.org) [030421 11:48]:
> A few questions about running chrony.
> 
> 1) How do I debug chrony?  How do I see what it's doing (or not doing)?

Sorry, I can't help you there; I'm not currently running it anywhere and
don't remember it well enough to speak from memory.

> 2) With NTP in the past I've always listed multiple servers.  I thought
> the idea was to sync with a few servers to figure out network delays and
> such.  Should I list multiple servers with chrony?

Yes, chrony is an implementation of NTP.  Multiple servers are good for
the same reasons you've always used multiple servers.

> 3) I'm confused about syncing the hardware clock with the real time.  I'd
> like to have the hardware clock updated, too.  On other machines I've got
> ntp and ntpdate installed.
> 
> IIRC, I used to use ntpdate with ntp.  I'm not clear if that's correct
> or not, though.  I guess I used ntpdate to refresh the time to the current
> time on boot to avoid a long slew time by ntp.

FYI, You can use 'ntpd -q' to get functionality similar to ntpdate's.

> If I read the docs correctly, /var/lib/chrony/chrony.rtc is written at
> shutdown to say how far off the hardware clock is and that is used at
> startup next time to determine how to set the system time (based on how
> long the power was off, and the rate of time gain/loss.
> 
> Still, it would be nice to keep my hardware clock close to real time.  Is
> there a way to do that within chrony?  Or do I need to use hwclock command
> (in cron, for example).

AFAIK, chrony does try to keep your hardware clock close to real time.
The chrony.rtc file is used to keep track of how fast or how slow your
clock runs.  I'm no expert, but I believe it stores information like
"this hardware clock ticks 0.996 seconds in one actual second" rather
than "this hardware clock is 60000 ticks behind".  With the information
on how fast or slow the clock is, chrony thinks to itself on startup
"well, the hardware clock thinks I've been powered off for 996 seconds,
so I should set the clock 4 seconds forward to compensate for how slowly
I've seen it run in the past".

I haven't looked at the code (or even dug deep into the docs), but I
think that's how it works.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
http://www.digitalconsumer.org/

Attachment: pgp53e5_d1O1z.pgp
Description: PGP signature


Reply to: