Skip to content

Commit

Permalink
[COOK-3950] runit cookbook should use full service path when checking…
Browse files Browse the repository at this point in the history
… running status

Signed-off-by: Sean OMeara <someara@opscode.com>
  • Loading branch information
zuazo authored and Sean OMeara committed Dec 18, 2013
1 parent b9377f4 commit 286addb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/provider_runit_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions test/spec/libraries/provider_runit_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 286addb

Please sign in to comment.