From 8b1619b60e3dddceef73b886de584f27f5ef7bb5 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Wed, 8 Mar 2017 21:51:04 +0100 Subject: [PATCH] try to use sysv fallback if is not producing proper output Signed-off-by: Christoph Hartmann --- lib/resources/service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resources/service.rb b/lib/resources/service.rb index 4fb033193..383a739df 100644 --- a/lib/resources/service.rb +++ b/lib/resources/service.rb @@ -336,7 +336,7 @@ module Inspec::Resources status = inspec.command("#{service_ctl} status #{service_name}") # fallback for systemv services, those are not handled via `initctl` - return SysV.new(inspec).info(service_name) if status.exit_status.to_i != 0 + return SysV.new(inspec).info(service_name) if status.exit_status.to_i != 0 || status.stdout == '' # @see: http://upstart.ubuntu.com/cookbook/#job-states # grep for running to indicate the service is there