There seems to be a problem with tor and runit. Here is the issue I faced.
I've installed tor and tor-runit. I added tor to the runit services:
ln -s /etc/runit/sv/tor /run/runit/service
But it doesn't start. Even if I stop and restart, when I start tor from runit, it doesn't start.
down: /run/runit/service/tor: 1s, normally up, want up
I'm not sure how to check for the log for a runit service, so I tried to start tor manually, and this is what I get.
$ sudo tor
[notice] Tor 0.4.3.5 running on Linux with Libevent 2.1.11-stable, OpenSSL 1.1.1g, Zlib 1.2.11, Liblzma 5.2.5, and Libzstd 1.4.4.
[notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
[notice] Read configuration file "/etc/tor/torrc".
[notice] Opening Socks listener on 127.0.0.1:9050
[notice] Opened Socks listener on 127.0.0.1:9050
[warn] /var/lib/tor is not owned by this user (root, 0) but by tor (43). Perhaps you are running Tor as the wrong user?
[notice] Closing partially-constructed Socks listener on 127.0.0.1:9050
[warn] Failed to parse/validate config: Couldn't create private data directory "/var/lib/tor"
[err] Reading config failed--see warnings above.
It seems that when installed with pacman, tor creates a director /var/lib/tor owned by the user tor (I've since removed this dir and reinstalled tor and to check if it's created during installation).
Anyway, my fix was to change the ownership of /var/lib/tor to the root user.
I'm not sure if I'm missing something, or tor changed its behavior recently, but is this the right way to solve it?