Two processes cannot bind (and listen) to the same unix socket. A process which tries to bind to an already existing unix socket will get an EADDRINUSE
error.
Concretely, I can start two gunicorn processes with the same --bind unix:/ and no obvious error occurs
It's probable that your gunicorn
process is actually removing the socket file before binding to it, and so it ends up binding to a different unix socket.
Keep in mind that the actual address of a unix socket is the device_id:inode
tuple, not the path through which it was accessed. If you remove a unix socket, a program which binds to the same path will end up creating a different socket file, with a different inode.
Note: all this applies to "normal", filesystem-resident Unix sockets. Linux also has abstract unix sockets, where the name of the socket is its actual address, and which do not use any kind of filesystem object. For these too, you won't be able to bind two sockets to the same address.