"HiddenServicePort with no preceding HiddenServiceDir directive"
errors from my syslog after updating to tor v2.8.6.1 in ubuntu 16 and rebooting:
[notice] Tor v0.2.8.6 (git-2c0d81c26eefc1f6) running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2g-fips and Zlib 1.2.8.
[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 "/usr/share/tor/tor-service-defaults-torrc".
[notice] Read configuration file "/etc/tor/torrc".
[warn] HiddenServicePort with no preceding HiddenServiceDir directive
[warn] Failed to parse/validate config: Failed to configure rendezvous options. See logs for details.
[err] Reading config failed--see warnings above.
systemd[1]: [email protected]: Control process exited, code=exited status=1
systemd[1]: Failed to start Anonymizing overlay network for TCP.
systemd[1]: [email protected]: Unit entered failed state.
systemd[1]: [email protected]: Failed with result 'exit-code'.
systemd[1]: [email protected]: Service hold-off time over, scheduling restart.
systemd[1]: Stopped Anonymizing overlay network for TCP.
systemd[1]: Starting Anonymizing overlay network for TCP...
tor[4826]: .500 [notice] Tor v0.2.8.6 (git-2c0d81c26eefc1f6) running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2g-fips and Zlib 1.2.8.
tor[4826]: .500 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
tor[4826]: .500 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
tor[4826]: .500 [notice] Read configuration file "/etc/tor/torrc".
tor[4826]: .503 [warn] HiddenServicePort with no preceding HiddenServiceDir directive
tor[4826]: .504 [warn] Failed to parse/validate config: Failed to configure rendezvous options. See logs for details.
tor[4826]: .504 [err] Reading config failed--see warnings above.
systemd[1]: [email protected]: Control process exited, code=exited status=1
systemd[1]: Failed to start Anonymizing overlay network for TCP.
systemd[1]: [email protected]: Unit entered failed state.
systemd[1]: [email protected]: Failed with result 'exit-code'.
systemd[1]: [email protected]: Service hold-off time over, scheduling restart.
systemd[1]: Stopped Anonymizing overlay network for TCP.
systemd[1]: Starting Anonymizing overlay network for TCP...
systemd-logind[3249]: Removed session c2.
systemd[1]: Stopping User Manager for UID 108...
systemd[3898]: Reached target Shutdown.
systemd[3898]: Starting Exit the Session...
tor wouldn't start. I also noticed:
apparmor="DENIED" operation="open" profile="system_tor" name="/var/lib/tor/hidden_service/" pid=5051 comm="tor" requested_mask="r" denied_mask="r" fsuid=0 ouid=122
my apparmor profile was blocking access to my hidden service dir.
$ cat /etc/apparmor.d/system_tor
owner /var/lib/tor/** rwk,
changed it to:
/var/lib/tor/** rwk,
removing "owner" fixes the issue with tor, it start without errors now.
is it generally okay to remove "owner" from the apparmor profile? is there another resolution for the syslog errors?