diff --git a/MPF.md b/MPF.md index f87a979e1e..f50498923f 100644 --- a/MPF.md +++ b/MPF.md @@ -623,7 +623,7 @@ When enabled, the policy will make sure that all units are enabled, unless they **Description:** Disable a CFEngine Enterprise daemon component persistently. -`DAEMON` can be one of `cf_execd`, `cf_monitord` or `cf_serverd`. +`DAEMON` can be one of `cf_execd`, `cf_monitord`, `cf_reactor` or `cf_serverd`. This will stop the AGENT from starting automatically. @@ -645,7 +645,7 @@ This [augments file][Augments] will ensure that `cf-monitord` is disabled on hos **Description:** Re-enable a previously disabled CFEngine Enterprise daemon component. -`DAEMON` can be one of `cf_execd`, `cf_monitord` or `cf_serverd`. +`DAEMON` can be one of `cf_execd`, `cf_monitord`, `cf_reactor` or `cf_serverd`. This [augments file][Augments] will ensure that `cf-monitord` is not disabled on `redhat` hosts. diff --git a/cfe_internal/update/update_processes.cf b/cfe_internal/update/update_processes.cf index 86d35e6d93..f7b03f9e12 100644 --- a/cfe_internal/update/update_processes.cf +++ b/cfe_internal/update/update_processes.cf @@ -28,8 +28,8 @@ bundle agent cfe_internal_update_processes # state should be. # # By default all the relevant services will run on each host. For example all -# hosts will run cf-execd, cf-serverd, and cf-monitord. Individual services can -# be disabled: +# hosts will run cf-execd, cf-serverd, cf-monitord, and cf-reactor (when +# installed). Individual services can be disabled: # # * If persistent_disable_COMPONENT ( persistent_disable_cf_serverd, # persistent_disable_cf_monitord) is defined the service will be disabled. @@ -65,15 +65,17 @@ bundle agent cfe_internal_update_processes "agent[cf_serverd]" string => "cf-serverd"; "agent[cf_monitord]" string => "cf-monitord"; + "agent[cf_reactor]" + string => "cf-reactor", + if => fileexists("$(sys.bindir)/cf-reactor"), + comment => "cf-reactor is installed on all hosts since 3.29.0, older + clients may not have it"; + policy_server.enterprise_edition:: "agent[cf_hub]" string => "cf-hub", comment => "cf-hub is only relevant on Enterprise hubs"; - "agent[cf_reactor]" - string => "cf-reactor", - comment => "cf-reactor is only provided on Enterprise hubs"; - systemd:: # On systemd hosts the cfengine3 service acts as an umbrella for other # services. @@ -269,7 +271,7 @@ bundle agent maintain_cfe_hub_process ############################################################################### bundle agent disable_cfengine_agents(process) # @brief Ensure cfengine component is not running -# @param process The name of the cfengine component binary to ensure not running. [cf-agent, cf-serverd, cf-monitord, cf-hub] +# @param process The name of the cfengine component binary to ensure not running. [cf-agent, cf-serverd, cf-monitord, cf-hub, cf-reactor] { vars: !windows:: @@ -297,7 +299,7 @@ bundle agent disable_cfengine_agents(process) ############################################################################### bundle agent enable_cfengine_agents(process) # @brief Ensure cfengine component is running -# @param process The name of the cfengine component binary to ensure running. [cf-agent, cf-serverd, cf-monitord, cf-hub] +# @param process The name of the cfengine component binary to ensure running. [cf-agent, cf-serverd, cf-monitord, cf-hub, cf-reactor] { vars: !windows:: diff --git a/cfe_internal/update/windows_unattended_upgrade.cf b/cfe_internal/update/windows_unattended_upgrade.cf index 1b53cb1f6a..b56ab5cdc9 100644 --- a/cfe_internal/update/windows_unattended_upgrade.cf +++ b/cfe_internal/update/windows_unattended_upgrade.cf @@ -64,6 +64,7 @@ exit /B REM kill all cf procs first so that installed can run Taskkill /IM cf-execd.exe /F Taskkill /IM cf-monitord.exe /F +Taskkill /IM cf-reactor.exe /F Taskkill /IM cf-serverd.exe /F Taskkill /IM cf-agent.exe /F set bat="$(sys.workdir)$(const.dirsep)modules$(const.dirsep)packages$(const.dirsep)msiexec.bat" diff --git a/templates/cf-reactor.service.mustache b/templates/cf-reactor.service.mustache index 0a2dfcab4b..22d5f543cd 100644 --- a/templates/cf-reactor.service.mustache +++ b/templates/cf-reactor.service.mustache @@ -1,13 +1,17 @@ [Unit] -Description=CFEngine Enterprise event reaction daemon +Description=CFEngine event reaction daemon PartOf=cfengine3.service ConditionPathExists={{{vars.sys.bindir}}}/cf-reactor ConditionPathExists={{{vars.sys.default_policy_path}}} After=syslog.target After=network.target +{{#classes.enterprise_edition}} +{{#classes.policy_server}} Wants=cf-postgres.service After=cf-postgres.service +{{/classes.policy_server}} +{{/classes.enterprise_edition}} [Service] Type=simple