Skip to content

Commit

Permalink
Don't close systemd activated socket on pumactl restart
Browse files Browse the repository at this point in the history
Closes puma#2504
  • Loading branch information
MSP-Greg committed Mar 2, 2021
1 parent a192434 commit 502e3bc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/puma/binder.rb
Expand Up @@ -258,14 +258,18 @@ def parse(binds, logger, log_msg = 'Listening')
end

# Also close any unused activated sockets
@activated_sockets.each do |key, sock|
logger.log "* Closing unused activated socket: #{key.join ':'}"
begin
sock.close
rescue SystemCallError
unless @activated_sockets.empty?
fds = @ios.map(&:to_i)
@activated_sockets.each do |key, sock|
next if fds.include? sock.to_i
logger.log "* Closing unused activated socket: #{key.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
# We have to unlink a unix socket path that's not being used
File.unlink key[1] if key[0] == :unix
end
end

Expand Down

0 comments on commit 502e3bc

Please sign in to comment.