bugfix: support for sudo and service on debian

This commit is contained in:
Christoph Hartmann 2015-10-22 16:20:35 +02:00
parent 807ee03e8b
commit 28c497a492

View file

@ -204,7 +204,13 @@ class SysV < ServiceManager
# check if service is really running
# service throws an exit code if the service is not installed or
# 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)
{
name: service_name,