diff --git a/libraries/provider_runit_service.rb b/libraries/provider_runit_service.rb index 23c1658..7244d55 100644 --- a/libraries/provider_runit_service.rb +++ b/libraries/provider_runit_service.rb @@ -249,12 +249,12 @@ def runit_send_signal(signal, friendly_name = nil) end def running? - cmd = shell_out("#{new_resource.sv_bin} #{sv_args}status #{new_resource.service_name}") + cmd = shell_out("#{new_resource.sv_bin} #{sv_args}status #{service_dir_name}") (cmd.stdout =~ /^run:/ && cmd.exitstatus == 0) end def log_running? - cmd = shell_out("#{new_resource.sv_bin} #{sv_args}status #{new_resource.service_name}/log") + cmd = shell_out("#{new_resource.sv_bin} #{sv_args}status #{service_dir_name}/log") (cmd.stdout =~ /^run:/ && cmd.exitstatus == 0) end diff --git a/test/spec/libraries/provider_runit_service_spec.rb b/test/spec/libraries/provider_runit_service_spec.rb index 4a897da..dc6bd53 100644 --- a/test/spec/libraries/provider_runit_service_spec.rb +++ b/test/spec/libraries/provider_runit_service_spec.rb @@ -32,6 +32,7 @@ let(:run_script) { File.join(service_dir, service_name, 'run') } let(:log_run_script) { File.join(service_dir, service_name, 'log', 'run') } let(:log_config_file) { File.join(service_dir, service_name, 'log', 'config') } + let(:node) do node = Chef::Node.new node.automatic['platform'] = 'ubuntu'