mirror of
https://github.com/inspec/inspec
synced 2024-11-24 05:33:17 +00:00
Merge pull request #638 from spuranam/suse-service
Add support for suse 11 to service resource
This commit is contained in:
commit
aede111f93
1 changed files with 8 additions and 2 deletions
|
@ -94,7 +94,7 @@ module Inspec::Resources
|
||||||
return skip_resource 'The `service` resource is not supported on your OS yet.' if @service_mgmt.nil?
|
return skip_resource 'The `service` resource is not supported on your OS yet.' if @service_mgmt.nil?
|
||||||
end
|
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
|
os = inspec.os
|
||||||
family = os[:family]
|
family = os[:family]
|
||||||
|
|
||||||
|
@ -135,8 +135,14 @@ module Inspec::Resources
|
||||||
WindowsSrv.new(inspec)
|
WindowsSrv.new(inspec)
|
||||||
elsif %w{freebsd}.include?(family)
|
elsif %w{freebsd}.include?(family)
|
||||||
BSDInit.new(inspec, service_ctl)
|
BSDInit.new(inspec, service_ctl)
|
||||||
elsif %w{arch opensuse}.include?(family)
|
elsif %w{arch}.include?(family)
|
||||||
Systemd.new(inspec, service_ctl)
|
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)
|
elsif %w{aix}.include?(family)
|
||||||
SrcMstr.new(inspec)
|
SrcMstr.new(inspec)
|
||||||
elsif %w{amazon}.include?(family)
|
elsif %w{amazon}.include?(family)
|
||||||
|
|
Loading…
Reference in a new issue