I am setting up a bitcoin full node on my fedora 28 machine. I am setting it up to accept connections via my onion address and my ip address.
After installing tor
dnf install tor
I enter into my torrc file
vim /etc/tor/torrc
and enter:
HiddenServiceDir /var/lib/tor/bitcoin-service/
HiddenServicePort 8333 127.0.0.1:8333
Exit torrc file and then restart tor by
systemctl restart tor.service
Everything good until up to here. Now, I never had an issue when I'd set this up on Debian systems, but I'd also restart tor with
sudo /etc/init.d/tor restart
but when I do this on Fedora, I get the error
sudo: /etc/init.d/tor: command not found
My understanding is that
systemctl restart tor.service
is the proper way to restart tor on Fedora. However, this produces the following error:
Job for tor.service failed because the control process exited with error code. See "systemctl status tor.service" and "cournalctl -xe" for details.
systemctl status tor.service
Produces the log output:
tor.service - Anonymizing overlay network for TCP
Loaded: loaded (/usr/lib/systemd/system/tor.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) . since Mon 2018-05-14 17:56:34 EDT; 1s ago
Process: 19861 ExecStartPre=/usr/bin/tor --runasdaemon 0 --defaults-torrc /usr/share/tor/defaults-torrc -f /etc/tor/torrc --verify-config (code=exited, status =1/FAILURE)
localhost.localdomain systemd[1]: tor.service: Service hold-off time over, scheduling restart.
localhost.localdomain systemd[1]: tor.service: Scheduled restart job, restart counter is at 5
localhost.localdomain systemd[1]: Stopped Anonymizing overlay network for TCP.
localhost.localdomain systemd[1]: tor.service: Start request repeated too quickly.
localhost.localdomain systemd[1]: tor.service: Failed with result 'exit-code'.
localhost.localdomain systemd[1]: Failed to start Anonymizing overlay network for TCP.
line 1-11/11 (END)
And:
journalctl -xe
Produces the log output:
Unit tor.service has begun starting up.
localhost.localdomain tor [20336]: [notice] Tor 0.3.2.10 (git -31cc63deb69db819) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.0h-fips, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
localhost.localdomain tor [20336]: [notice] Read configuration file "/usr/share/tor/defaults-torrc".
localhost.localdomain tor [20336]: [notice] Read configuration file "/etc/tor/torrc".
localhost.localdomain audit [20336]: AVC avc: denied { dacreadsearch } for pid=20336 comm="tor" capability=2 scontext=systemu:systemr:tort:s0 tcontext=systemu:systemrtort:s0 tclass=capability permissive=0
localhost.localdomain audit [20336]: AVC avc: denied {dacoverride } for pid=20336 comm="tor" capability=1 scontext=systemu:systemr:tort:s0 tcontext=systemu:systemr:tort:s0 tcpmtext=systemu:systemr:tort:s0 tclass=capability permissive=0
localhost.localdomain tor[20336] [warn] Directory /var/lib/tor/bitcoin-service/ cannot be read: Permission denied
localhost.localdomain tor[20336] [warn] Failed to parse/validate config: Failed to configure rendezvous options. See logs for details.
localhost.localdomain tor[20336] [err] Reading config failed --see warnings above.
localhost.localdomain systemd[1]: tor.service: Control process exited, code=exited status=1
localhost.localdomain systemd[1]: tor.service: Failed with result 'exit-code'.
localhost.localdomain systemd[1]: Failed to start Anonymizing overlay network for TCP.
--Subject: unit tor.service has failed
--Defined-By: systemd
--Unit tor.service has failed
line 1818-1840/1840 (END)
I don't understand why I'm getting the permission denied error for /var/lib/tor/bitcoin-service/ but I assume that's a big part of the error. But since I had just ran
dnf install tor
I was still running as root, so I don't understand the permission denied.
Thanks in advance for any help