[chrony-users] Chrony setup using RTC as fallback

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


I have an embedded system (ARM9/Buildroot) that may or may not be connected to the Internet (usually it is, but it should work also in "detached" mode; connection may come up a long time after boot).

I need to /ensure/ dates are strictly monotonic; no "jump back" larger then one second should be allowed.

The system is equipped with an RTC performing reasonably well.

My current configuration is as follows (see below), but it doesn't seem to work very well: sometimes, even if connected, it takes several minutes to switch from "default" date (Jan 2007) to the correct one.

In general workflow at boot should be as follows:

1) boot (obviously ;) )
2) read sysclock from RTC (ASAP! before network connection goes up)
3) read last recorded time and, IF later than sysclock THEN sysclock = last recorded time + 1sec.
4) wait for network to go up
5) sync time THEN
5.1) IF net time > sysclock THEN sysclock = net time
5.2) IF net time < sysclock THEN slow sysclock TILL sysclock == net time

At shutdown time sysclock should be saved.

I understand all this should be possible with chrony, but I didn't find the right spell.

Can someone help me? I'm lost in a maze of twisting little options, all conflicting!

TiA!

==== chrony.conf ====

|initstepslew 30 2.it.pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org server 0.it.pool.ntp.org offline server 1.it.pool.ntp.org offline server 2.pool.ntp.org offline server 3.pool.ntp.org offline logdir /var/log/chrony log rtc statistics measurements tracking logchange 1 driftfile /var/lib/chrony/drift keyfile /etc/chrony.keys generatecommandkey makestep 1.0 3 maxupdateskew 100.0 dumponexit dumpdir /var/lib/chrony rtconutc rtcautotrim 1 rtcfile /var/lib/chrony/rtc |

==== dhcpd.conf ====

|hostname duid persistent option rapid_commit option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes option ntp_servers require dhcp_server_identifier nohook lookup-hostname ipv4only background release timeout 0 |

==== dhcpd.enter-hook ====

|#!/bin/ash #echo >>/tmp/log "********* $interface : $reason *********" |

==== dhcpd.exit-hook ====

|#!/bin/ash case $reason in NOCARRIER) # echo >>/tmp/log "--------- chrony offline ---------" /usr/bin/chronyc offline ;; BOUND) # echo >>/tmp/log "--------- chrony online ---------" /usr/bin/chronyc online ;; esac |


--
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/