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

Add ability to cleanup stale unix sockets

This commit is contained in:
Evan Phoenix 2013-07-04 15:57:49 -07:00
parent 7c73c52249
commit f124bc21cd

View file

@ -255,6 +255,18 @@ module Puma
begin
old_mask = File.umask(umask)
if File.exists? path
begin
old = UNIXSocket.new path
rescue SystemCallError
File.unlink path
else
old.close
raise "There is already a server bound to: #{path}"
end
end
s = UNIXServer.new(path)
@ios << s
ensure