Is there any way to have UNIX domain sockets be cleaned up automatically when the process that created them exits?
If your application only needs to run on Linux, you can use an abstract unix socket (a socket where the path starts with a NULL byte). Abstract sockets are cleaned up automatically when the server process ends.