mirror of
https://github.com/inspec/inspec
synced 2024-12-04 02:19:50 +00:00
bugfix: support for sudo and service on debian
This commit is contained in:
parent
807ee03e8b
commit
28c497a492
1 changed files with 7 additions and 1 deletions
|
@ -204,7 +204,13 @@ class SysV < ServiceManager
|
||||||
# check if service is really running
|
# check if service is really running
|
||||||
# service throws an exit code if the service is not installed or
|
# service throws an exit code if the service is not installed or
|
||||||
# not enabled
|
# not enabled
|
||||||
cmd = @vulcano.command("/sbin/service #{service_name} status")
|
|
||||||
|
# on debian service is located /usr/sbin/service, on centos it is located here /sbin/service
|
||||||
|
service_cmd = 'service'
|
||||||
|
service_cmd = '/usr/sbin/service' if @vulcano.os[:family] == 'debian'
|
||||||
|
service_cmd = '/sbin/service' if @vulcano.os[:family] == 'centos'
|
||||||
|
|
||||||
|
cmd = @vulcano.command("#{service_cmd} #{service_name} status")
|
||||||
cmd.exit_status == 0 ? (running = true) : (running = false)
|
cmd.exit_status == 0 ? (running = true) : (running = false)
|
||||||
{
|
{
|
||||||
name: service_name,
|
name: service_name,
|
||||||
|
|
Loading…
Reference in a new issue