Ensure exit status code for detached_command method result

This commit is contained in:
uu59 2015-01-14 13:38:33 +09:00
parent f80ab8a69a
commit afc6cca460

View File

@ -133,11 +133,12 @@ class Fluentd
end
def detached_command(cmd)
Bundler.with_clean_env do
thread = Bundler.with_clean_env do
pid = spawn(cmd)
Process.detach(pid)
end
sleep 1 # NOTE/FIXME: too early return will be caused incorrect status report, "sleep 1" is a adhoc hack
thread.join
thread.value.exitstatus
end
end
end