Use a lock file in addition to the UNIX domain socket file
When a server listens on UNIX domain socket only, it unconditionally unlink()s any existing socket before trying to bind() it. If that socket belonged to a still-running server, it's no longer contactable.
This isn't a problem on Linux, as ordinarily an attempt is made to create an abstract socket first (which fails if it's already bound). But if that's turned off, or on a different OS which doesn't support abstract sockets, this will cause problems.
eg. 'Xvfb -displayfd 2 -nolisten local &' repeated always gets allocated the same display number.