I need to make a change to chronyd used by balena OS.
I basically want to ensure chronyd’s configuration points to a shared folder, that my container can mess with.
For that I need to be able to run a chronyd command on the balena OS on boot or during normal operation (automatically) chronyd -f </path>.
Is there a way to run automatically commands on the Balena OS?
I’m not sure what configuration settings you are trying to change, but would chronyc running inside your container allow the configuration you need to be altered that way, rather than editing the file?
I haven’t tried it, but I suspect the Chronyc CLI would permit it. You would want to check whether it is persistent though. There may also be a need to provide some elevated privileges to grant the container that communicates with the local Chronyd instance.
If you are able to test it, could you let us know the progress?
Hi, I am guessing this is a continuation from a different thread, and the objective is to be able to configure the NTP servers by launching chronyd with a different configuration.
As mentioned in the other comment, balenaOS can configure the NTP servers by adding an entry to config.json. However, we still do not expose this setting via the supervisor, so the only way to change it is to modify config.json directly which is not ideal.
Another option that I didn’t mention in the other thread, is to actually run chronyd in a privileged container. You could stop the hostOS chronyd using dbus on application start and launch chronyd in the application, having complete control over its configuration.
We will try this approach, nonetheless we would like to know if, after stopping chronyd in BalenaOs and starting in the app container, it uses the same ntp servers as the app container.
In other words, does the Host follow the chronyd running in the app container?
Is there any way to know which are the ntp servers being used by the Host, testing on the Host cli?
When you run the chronyd in the container, it will read the default NTP servers from its configuration file. Any other update you will have to update chrony sources manually.
The chronyd in the container will then keep the system time.