3

We have a machine with a GPS connected that we're using as a timeserver, by way of gpsd and chrony.

The problem is, the GPS is occasionally unavailable. We'd still like the other machines on our network to continue syncing their time to the GPS-controlled timeserver. But we're not sure how to configure chrony to ensure that this takes place. Even if the GPS is offline for an extended period, we still want all other machines to sync to this one, despite the possibility that it's clock has drifted from real GPS time.

It looks like the 'local' configuration setting may be helpful, but the documentation is sketchy. Will this setting tell chrony to fall back to the local system clock if a reference clock is not available, but then sync itself with the reference clock when it comes back online? Or is there some other approach altogether that will work?

These are all Redhat 6.5 systems, running chrony 1.31.1.

SixDegrees
  • 781
  • 1
  • 8
  • 19

1 Answers1

2

So, it appears that chrony behaves transparently here. It reliably reports time using the time server of its choice when one is available, then falls back to using local clock time if there is no external server it can reach. By adding

local stratum 10

to the config file, it will happily switch back and forth based on the availability of servers, and their ranking. Although how servers are ranked remains largely opaque, testing strongly suggests that this will meet our needs. chrony will also happily examine the timestamp of its own drift file on startup, and substitute this time for the system time if no server at all can be found, i.e., when there is no Internet connection and the RTC battery has died. Which is exactly the behavior we're looking for.

There are some aspects of chrony I can't yet test - I'm working with virtual machines at the moment, and they don't emulate actual hardware clocks well, so there's more to investigate when I get back to the real system, but that's another topic.

SixDegrees
  • 781
  • 1
  • 8
  • 19