Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for suse 11 to service resource #638

Merged
merged 3 commits into from
Apr 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/resources/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def initialize(service_name, service_ctl = nil)
return skip_resource 'The `service` resource is not supported on your OS yet.' if @service_mgmt.nil?
end

def select_service_mgmt # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def select_service_mgmt # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
os = inspec.os
family = os[:family]

Expand Down Expand Up @@ -135,8 +135,14 @@ def select_service_mgmt # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticCom
WindowsSrv.new(inspec)
elsif %w{freebsd}.include?(family)
BSDInit.new(inspec, service_ctl)
elsif %w{arch opensuse}.include?(family)
elsif %w{arch}.include?(family)
Systemd.new(inspec, service_ctl)
elsif %w{suse opensuse}.include?(family)
if inspec.os[:release].to_i >= 12
Systemd.new(inspec, service_ctl)
else
SysV.new(inspec, service_ctl || '/sbin/service')
end
elsif %w{aix}.include?(family)
SrcMstr.new(inspec)
elsif %w{amazon}.include?(family)
Expand Down