[chrony-users] "chronyc waitsync" never completes if first server connection attempts fail

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


Hi,

I have just been looking at using “chronyc waitsync” in startup scripts for processes that need an accurate time.

I noticed that waitsync never successfully connects to the server if the first connection attempts fail. This is the case if the chronyc process starts before the chronyd process starts listening.

The patch below fixes it for me. The change is in client.c, open_io(). When the loop in open_io() fails to open any servers, it resets the address index so that a subsequent call to open_io() (as in the waitsync loop) retries connections to all the servers.

Regards,

Jan M.


diff -du chrony-4.2.orig/client.c chrony-4.2/client.c
--- chrony-4.2.orig/client.c 2021-12-16 13:17:42.000000000 +0100
+++ chrony-4.2/client.c 2022-01-25 19:21:47.461456000 +0100
@@ -283,6 +283,8 @@
     close_io();
   }
 
+  address_index = 0;
+
   return 0;
 }
 


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