Skip to content

Tor systemd service should have ReadWriteDirectories=/var/run/tor

Tor writes it's pidfile to /var/run/tor/tor.pid by default.

However, ​https://gitweb.torproject.org/tor.git/tree/contrib/dist/tor.service.in specifies that all but 2 directories are read only. Therefore, when one starts tor using:

systemctl start tor

using the default configuration, this error is logged in the journal:

Jul 26 22:42:32 irrational Tor[19048]: Unable to open "/var/run/tor/tor.pid" for writing: Read-only file system

and no pidfile is written.

Adding:

ReadWriteDirectories=-/var/run/tor

to the [Service] section fixes the problem.

Trac:
Username: candrews

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information