Commit 77cd7f0f authored by Jonathan Hartman's avatar Jonathan Hartman Committed by Ben Abrams
Browse files

Force Chef to use Systemd on platforms that support it

Otherwise, Chef manages the service by calling the init script directly. This
leaves Systemd out of sync and `service collector *` claiming the service has
crashed while `/etc/init.d/collector *` properly reports that it's running.

Also enables support in the service for the status and restart commands.
parent 7c189606
......@@ -150,6 +150,10 @@ def sumo_service(action = :nothing)
service_name 'collector' unless node['platform_family'] == 'windows'
retries new_resource.service_retries
retry_delay new_resource.service_retry_delay
supports status: true, restart: true
if Chef::Platform::ServiceHelpers.service_resource_providers.include?(:systemd)
provider Chef::Provider::Service::Systemd
end
action action
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment