I have defined a systemd init config
service 'solr' do provider Chef::Provider::Service::Systemd retries 5 retry_delay 10 action [:enable, :start] end
I notice in
systemctl status solr.service it gives the following warning.
Warning: solr.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Is there a native way to run daemon-reload with the service resource?
Looking at the ruby docs for
action :reload it appears to run the following command
systemctl reload foo
I don’t see a native way to do a daemon-reload.
What the correct way to run systemctl daemon-reload with chef? Do I need to do something like this?
execute 'systemctl daemon-reload' do command 'systemctl daemon-reload' action :nothing end template '/etc/systemd/system/solr.service' do source 'systemd/solr.service.erb' owner 'root' group 'root' action :create notifies :run, 'execute[systemctl daemon-reload]', :immediately notifies :restart, 'service[solr]', :delayed end service 'solr' do provider Chef::Provider::Service::Systemd retries 5 retry_delay 10 action [:enable, :start] end