Affects Version/s: None
Fix Version/s: 3.10.0
In cf-execd/cf-execd-runner.c cf-execd scans exec_command looking to see if the class from_cfexecd is defined by searching for -Dfrom_cfexecd. If it is not found it is appended to exec_command.
It seems the MPF got out of sync with the code in that regard. In the MPF we explicitly define cf_execd_initiated
It is useful for cf-agent to know if it was executed as a scheduled run from cf-execd but there are 2 issues.
- The update policy is neglected. It doesn't know if it was executed from cf-execd. We should make sure the update policy is run and has a class defined indicating it was run from cf-execd.
- The class used to identify the run is not consistent between the MPF and core.
- Searching the master branch of the MPF I found 0 instances of the string from_cfexecd.
- Searching the master branch of the MPF I found 6 instances of cf_execd_initiated. All are used in exec_command in body executor control from cf_execd.cf
- Searching 3.6.x , 3.7.x, 3.8.x, and 3.9.x branches of masterfiles did not show any different usage of either class within the framework.
- I propose that the option -Dfrom_cfexecd,cf_execd_initiated is used for both the update and normal policy runs as defined in the MPF, I propose 0 changes to core.
- 33b0879e13757d7c854c68fe6a3500d554438ad4y PR to masterfiles master: https://github.com/cfengine/masterfiles/pull/725
- PR to masterfiles 3.9.x: https://github.com/cfengine/masterfiles/pull/726
- PR to masterfiles 3.8.x: https://github.com/cfengine/masterfiles/pull/727
- PR to masterfiles 3.7.x: https://github.com/cfengine/masterfiles/pull/728
- PR to masterfiles 3.6.x: https://github.com/cfengine/masterfiles/pull/729
- I would also be on board with dropping cf_execd_initiated even though I prefer that class name to from_cfexecd and switching all occurrences of cf_execed_initiated to from_cfexecd.
- Additionally I propose that the documentation for exec_command in body executor control be updated to indicate that ' -Dfrom_cfexecd' will be appended to any exec_command that does not already contain that string (note the leading space).
- 6fafe5b82ecc0fda274b75d74539160863f91cb1 PR to documentation master: https://github.com/cfengine/documentation/pull/1512
- PR to documentation 3.9: https://github.com/cfengine/documentation/pull/1513
- PR to documentation 3.8 : https://github.com/cfengine/documentation/pull/1514
- PR to documentation 3.7 : https://github.com/cfengine/documentation/pull/1515
- PR to documentation 3.6 : https://github.com/cfengine/documentation/pull/1516