Universal .conf file customization

I have a GPS timecard successfully running with vyos, but it requires two lines added to chrony.conf.

This can be done manually at run time or via the post-boot script, but /run/chrony/chrony.conf is (re)generated via service_ntp.py, so any updates to the NTP configuration will overwrite my customizations. I don’t plan to update it that often, but I dislike leaving something so fragile in place.

I believe the default recommendation is to contribute a new conf mode command, but I’m not familiar enough with the code base at this point to contribute. It also assumes the contribution would be accepted.

I was curious if, as an alternative, there was a means to add a custom line of configuration to any .conf file behind the scenes. For example:

set service ntp custom 1 'line 1'
set service ntp custom 2 'line 2'
set service ntp custom 3 'line 3'

Or, better yet, make use of include files:

set service ntp include 1 '/path/to/file'

This would be semi-universal and allow broader customization without the need for specific set commands for each service. Would such an approach be considered?

I suppose I could use /config/scripts/commit/post-hooks.d to check the contents of chrony.conf and re-add the two refclock lines if they are missing …

Add the feature request with the lines of conf which you need.
Include “raw” options or .conf config is a bad idea!

Using GPS based time sources to feed chrony is a good idea and should be added properly to the CLI as real feature.

Fair enough. It’s a bit more than just a few chrony set commands, though. I’ll write up everything and post it as a feature request.

1 Like