BUG/MEDIUM: unix: never unlink a unix socket from the file system
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Jun 2017 08:34:20 +0000 (10:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Jun 2017 08:34:20 +0000 (10:34 +0200)
commit68986abe93ea26e3507d3053d266d46dc6328b71
treed326bbd0099a08f3ef1d9d366c74867724a71bf2
parent0bedb8ac90ffdf1498a999c44d1c91556fb726ee
BUG/MEDIUM: unix: never unlink a unix socket from the file system

James Brown reported some cases where a race condition happens between
the old and the new processes resulting in the leaving process removing
a newly bound unix socket. Jeff gave all the details he observed here :

   https://www.mail-archive.com/haproxy@formilux.org/msg25001.html

The unix socket removal was an attempt at an optimal cleanup, which
almost never works anyway since the process is supposed to be chrooted.
And in the rare cases where it works it occasionally creates trouble.
There was already a workaround in place to avoid removing this socket
when it's been inherited from a parent's file descriptor.

So let's finally kill this useless stuff now to definitely get rid of
this persistent problem.

This fix should be backported to all stable releases.
src/proto_uxst.c