Open wduncanfraser opened 3 years ago
Also affected
For some reason I have not run into this when upgrading agents. Does it make sense to revert the change from #132 and replace it with something like this?
package 'sensu-go-agent' do
if latest_version?(new_resource.version)
action :upgrade
notifies :run, 'execute[daemon-reload]', :immediately
notifies :restart, 'service[sensu-agent]', :delayed
else
version new_resource.version
action :install
end
end
execute 'daemon-reload' do
command 'systemctl daemon-reload'
action :nothing
end
It looks like #132 has caused this cookbook to start failing converging for me when Sensu is being upgraded.
There is no reload operation defined in the systemd unit file shipped with the Sensu agent (At least on CentOS 7), which causes this to fail every time.
It looks like the original intent of the above PR was to fix the unit file itself not getting reloaded. This needs to go through a daemon-reload or through systemd generators. "reload" on a systemd unit has to be implemented in the unit, and is for the unit to reload itself if it can, without restarting.
Chef Version
Chef: 15
Input
sensu_agent 'default' do version node['ac_sensu_agent']['version'] end
Output
Impact
Cookbook failing to converge on agent upgrade.
Expected Behavior
Succesful upgrade of Sensu agents.
Actual Behavior
Converge failure due to undefined reload operation in systemd unit.