Re: [chrony-users] makestep in Chrony |
[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]
Hello Hei, i use the call chronyc waitsync 1 1 500 for knowing if chrony has already achieved synchronization. Attached a trivial shell script which you can use as boolean command: chrony_is_synced && do_something || fail_somehow_if_not_synced or you can call it chrony_is_synced -v to get the result on stdout. The first parameter to waitsync (1) tells chronyc to only check once, i.e. , the call will be (roughly) non-blocking. You can change that into "0" or a big number to get a blocking command, it will wait (long/forever) to sync. Attached also my "chrony_wait_sync" shell command). On purpose i use big max-correction and max-skew values (1 500), to allow for a fast(er) rough initial synchronization. BTW, chronyc burst will _NOT_ give you any synchronization warranty, it will only force so many measurements from (each) server. Hope it helps, Ariel On Thursday, 10 May 2018 12:16:29 CEST Hei Chan wrote: > Thanks Miroslav and Bill! > One last related question -- how can I be able to tell the sync/calibration > is done after I manually ask chrony to synch/calibrate? I saw one of the > posts 4 years ago suggesting that there is no way? Which command is better > to force chrony to synchronize time right now -- chronyc burst or chronyc > waitsync? > > Which command is better to force chrony to synchronize time right now --... > > Or even better -- is there a way that I can call through a C API and get a > callback or get blocked after it is done? Thanks!
Attachment:
chrony_wait_sync
Description: application/shellscript
Attachment:
chrony_is_synced
Description: application/shellscript
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |