Unverified Commit 48df58d6 authored by Ben Abrams's avatar Ben Abrams
Browse files

add support for `sumo_service` to override the init system

parent e5f07abd
......@@ -4,11 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG (now) follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased]
### Added
TBD
### Changed
TBD
### Added
- when using the lwrps it calls `sumo_service` which attempts to use systemd if present. We should allow overriding this behavior with the same attribute as was added in [PR#145](https://github.com/SumoLogic/sumologic-collector-chef-cookbook/pull/145) to change the behavior. If the attribute is unset it uses the existing logic to determine the appropriate init subsystem making this backwards compatibile. (@majormoses)
## [1.2.23] - 2017-10-12
### Added
......
......@@ -166,7 +166,9 @@ def sumo_service(action = :nothing)
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)
if !node['sumologic']['init_style'].nil?
provider node['sumologic']['init_style']
elsif Chef::Platform::ServiceHelpers.service_resource_providers.include?(:systemd)
provider Chef::Provider::Service::Systemd
end
action action
......
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