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:
parent
8648e057e4
commit
eb6468d558
2 changed files with 9 additions and 1 deletions
|
@ -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!"
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue