Details
-
Type:
Sub-task
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: 3.7.3
-
Fix Version/s: 3.11.0
-
Component/s: cf-execd, cf-monitord, cf-serverd
-
Labels:None
-
Story Points:1
Description
When only the augments file (def.json) is altered in /var/cfengine/masterfiles on the hub the change is seen and /var/cfengine/masterfiles/cf_promises_validated is updated however daemons do not seem to reload their configuration.
For example if I set mailto or mailfrom in def.json:
{ "vars": { "mailto": "nick@cmdln.org", "mailfrom": "nick@cmdln.org" } }
The daemons continue sending email to the mailto defined in def.mailto at the time the daemon was started. The new setting is only picked up after re-starting cf-execd.
I Merged https://github.com/cfengine/masterfiles/pull/928 to master and 3.11.x for 3.11.0. I do not currently plan to backport this to 3.10.x
Basically I just collect all the control variables for each component (using simple regex def.control_component_.*) and then render the seralized version of the data into state. If the file containing the serialized data under state is repaired then either cf-serverd or cf-monitord will be restarted.
Special Notes:
1) it's only compatible with 3.10.0 and greater. And it's leveraging the minimum_version macro so that if installed on a 3.7.x host it will not blow it up.
2) cf-execd is not restarted automatically. I haven't tested enough that doing so won't kill the executing agent leaving the host unmanaged.
3) Variables used by control bodies that do not match the simple pattern are not yet covered. They can likely be added via tag matching.