Usually, directories to store pid's or similar are created by the startup scripts of the services. (See this question)

However, I just noticed that these directories are still re-created after a reboot when I disable the services. This happened for all the services I tried.

root@sonorus:~# systemctl status openvpn
● openvpn.service - OpenVPN service
   Loaded: loaded (/lib/systemd/system/openvpn.service; disabled)
   Active: inactive (dead)
root@sonorus:~# systemctl status ejabberd
● ejabberd.service - A distributed, fault-tolerant Jabber/XMPP server
   Loaded: loaded (/lib/systemd/system/ejabberd.service; disabled)
   Active: inactive (dead)
     Docs: https://www.process-one.net/en/ejabberd/docs/

Which service is actually creating these directories?


With systemd, there is a new functionality called tmpfiles.d(5) that can be used to create files or directories on boot outside of the .service file. Openvpn and ejabberd are both using this, so that's why the directories in /var/run are still created even if they are not started on boot.

The tmpfiles configuration files are stored in /usr/lib/tmpfiles.d/

  • I could, for the sake of it, not find out what was creating these directories, but this is the solution. Thanks so much!
    – Zulakis
    Jan 5 '17 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.