Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot create UNIX socket in /run

According to FSH UNIX Sockets shall be created in /run (or on legacy distros in /var/run). I am trying to create a socket in a non-root application in that directory and get error 13. Is /run only for services started via systemd/init? If so, where do you put UNIX sockets from user applications?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is /run only for services started via systemd/init?

For root, yes.

where do you put UNIX sockets from user applications?

On modern systems in $XDG_RUNTIME_DIR if the variable is set, with fallback to /run/user/$UID if not set. For portability, you can use /tmp.

Usually $XDG_RUNTIME_DIR will be just set to /run/user/$uid.

https://renenyffenegger.ch/notes/Linux/fhs/run/user/uid/index https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading