Support for UNIX sockets
commitb538a34e8929fdc7ca8bd7d24da513327fd53a06
authorErik <ebernhardson@wikimedia.org>
Tue, 28 Jan 2014 23:33:17 +0000 (28 15:33 -0800)
committerSara Golemon <sgolemon@fb.com>
Tue, 28 Jan 2014 23:38:35 +0000 (28 15:38 -0800)
tree7b8866eaca27dfc9fc1299c23ce875c0b91852e4
parentc3b11e0c5553754b8b3dc64f204c2d52119a26b2
Support for UNIX sockets

Add a new config param, Server.FileSocket. When
Server.FileSocket
is set it will be used inplace of a network socket for the primary
server. This uses a new parameter to ServerOptions, m_useFileSocket,
to toggle between treating the address as a socket path or a network
address.

To initialize a socket connection thrift expects the socket file to not
exist. To support this the 'something nice' retry in startServer will
unlink an existing socket only if fuser claims it is unused.
Server.EvilShutdown enables unlinking the socket regardless of current
users.

Closes #1594

Reviewed By: @ptarjan

Differential Revision: D1135876

Pulled By: @sgolemon
hphp/runtime/base/runtime-option.cpp
hphp/runtime/base/runtime-option.h
hphp/runtime/server/fastcgi/fastcgi-server-factory.cpp
hphp/runtime/server/fastcgi/fastcgi-server.cpp
hphp/runtime/server/fastcgi/fastcgi-server.h
hphp/runtime/server/http-server.cpp
hphp/runtime/server/server.h