1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Handle HUP as a stop unless there is IO redirection. Fixes #911

This commit is contained in:
Evan Phoenix 2016-07-24 15:24:42 -07:00
parent 8648e057e4
commit eb6468d558
2 changed files with 9 additions and 1 deletions

View file

@ -387,7 +387,11 @@ module Puma
begin
Signal.trap "SIGHUP" do
@runner.redirect_io
if @runner.redirected_io?
@runner.redirect_io
else
stop
end
end
rescue Exception
log "*** SIGHUP not implemented, signal based logs reopening unavailable!"

View file

@ -94,6 +94,10 @@ module Puma
end
end
def redirected_io?
@options[:redirect_stdout] || @options[:redirect_stderr]
end
def redirect_io
stdout = @options[:redirect_stdout]
stderr = @options[:redirect_stderr]