mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Don't close systemd activated socket on pumactl restart (#2563)
Closes #2504
This commit is contained in:
parent
ca434803bc
commit
ae6a506029
2 changed files with 20 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
## Master
|
||||||
|
|
||||||
|
* Features
|
||||||
|
* Your feature goes here <Most recent on the top, like GitHub> (#Github Number)
|
||||||
|
|
||||||
|
* Bugfixes
|
||||||
|
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
|
||||||
|
* Don't close systemd activated socket on pumactl restart (#2563, #2504)
|
||||||
|
|
||||||
## 5.2.2 / 2021-02-22
|
## 5.2.2 / 2021-02-22
|
||||||
|
|
||||||
* Bugfixes
|
* Bugfixes
|
||||||
|
|
|
@ -258,14 +258,18 @@ module Puma
|
||||||
end
|
end
|
||||||
|
|
||||||
# Also close any unused activated sockets
|
# Also close any unused activated sockets
|
||||||
@activated_sockets.each do |key, sock|
|
unless @activated_sockets.empty?
|
||||||
logger.log "* Closing unused activated socket: #{key.join ':'}"
|
fds = @ios.map(&:to_i)
|
||||||
begin
|
@activated_sockets.each do |key, sock|
|
||||||
sock.close
|
next if fds.include? sock.to_i
|
||||||
rescue SystemCallError
|
logger.log "* Closing unused activated socket: #{key.first}://#{key[1..-1].join ':'}"
|
||||||
|
begin
|
||||||
|
sock.close
|
||||||
|
rescue SystemCallError
|
||||||
|
end
|
||||||
|
# We have to unlink a unix socket path that's not being used
|
||||||
|
File.unlink key[1] if key.first == :unix
|
||||||
end
|
end
|
||||||
# We have to unlink a unix socket path that's not being used
|
|
||||||
File.unlink key[1] if key[0] == :unix
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue