Search code examples
socketsunixzeromqfhs

Where to place ZeroMQ sockets' end point (files)?


As answered to this question, according to the FHS, Unix Domain (AF_UNIX) sockets' should be placed under /var/run

What about ZeroMQ sockets? Where should to place them?

Thanks


Solution

  • (a) The answer to that linked question isn't really correct, as the FHS is talking about Systems programs, which will always have appropriate privileges for /var/run, vs. applications which may not. The alternative in the other answer is to use /tmp/[appdirectory], which probably makes the most sense.

    (b) For most ZMQ use, this is irrelevant, ZMQ abstracts these details away from you, the developer. The exception is if you're using the IPC transport for inter-process communication, which uses a filehandle as the transport mechanism. Per that link, they point to a location in the /tmp directory as well - that example is not likely considered "best practice", but close enough that we can combine it with the first point to say you should probably use /tmp/[appdirectory]