I have a python application where I need to be able to dynamically add an NTP server to Chrony. From the command line I can do:
sudo chronyc add server time.google.com
My understanding is that chronyc interacts with /var/run/chrony/chronyd.sock to dynamically change chronyd. Looking at the source code I think I should be doing something like:
import socket
client = socket.socket( socket.AF_UNIX, socket.SOCK_STREAM )
client.bind('/tmp/my_chrony_sock.sock')
client.connect('/var/run/chrony/chronyd.sock')
client.send(b'add server time.google.com\n')
data = client.recv(4096)
But that just hangs never receiving a response