Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#68127 - [tor] Systemd service causes tor to restart every minute

Attached to Project: Arch Linux
Opened by Disinfectant Injector (Dinjector) - Wednesday, 07 October 2020, 00:26 GMT
Last edited by freswa (frederik) - Wednesday, 07 October 2020, 11:38 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To freswa (frederik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Systemd service causes tor to restart every minute

Additional info:
* package version(s)
tor-0.4.4.5-2

* config and/or log files etc.
Oct 06 19:05:50 tomato systemd[1]: Starting Anonymizing overlay network for TCP...
Oct 06 19:05:50 tomato tor[107219]: Oct 06 19:05:50.553 [notice] Tor 0.4.4.5 running on Linux with Libevent>
Oct 06 19:05:50 tomato tor[107219]: Oct 06 19:05:50.553 [notice] Tor can't help you if you use it wrong! Le>
Oct 06 19:05:50 tomato tor[107219]: Oct 06 19:05:50.553 [notice] Read configuration file "/etc/tor/torrc".
Oct 06 19:05:50 tomato tor[107219]: Configuration was valid
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.565 [notice] Tor 0.4.4.5 running on Linux with Libevent>
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.565 [notice] Tor can't help you if you use it wrong! Le>
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.565 [notice] Read configuration file "/etc/tor/torrc".
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.566 [notice] Opening Socks listener on 127.0.0.1:9050
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.566 [notice] Opened Socks listener on 127.0.0.1:9050
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.566 [notice] Opening DNS listener on 127.0.0.1:9053
Oct 06 19:05:50 tomato tor[107220]: Oct 06 19:05:50.566 [notice] Opened DNS listener on 127.0.0.1:9053
Oct 06 19:05:50 tomato Tor[107220]: Tor 0.4.4.5 running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1>
Oct 06 19:05:50 tomato Tor[107220]: Tor can't help you if you use it wrong! Learn how to be safe at https:/>
Oct 06 19:05:50 tomato Tor[107220]: Read configuration file "/etc/tor/torrc".
Oct 06 19:05:50 tomato Tor[107220]: Opening Socks listener on 127.0.0.1:9050
Oct 06 19:05:50 tomato Tor[107220]: Opened Socks listener on 127.0.0.1:9050
Oct 06 19:05:50 tomato Tor[107220]: Opening DNS listener on 127.0.0.1:9053
Oct 06 19:05:50 tomato Tor[107220]: Opened DNS listener on 127.0.0.1:9053
Oct 06 19:05:50 tomato Tor[107220]: Parsing GEOIP IPv4 file /usr/share/tor/geoip.
Oct 06 19:05:50 tomato Tor[107220]: Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
Oct 06 19:05:50 tomato Tor[107220]: Bootstrapped 0% (starting): Starting
Oct 06 19:05:50 tomato Tor[107220]: Starting with guard context "default"
Oct 06 19:05:51 tomato Tor[107220]: Bootstrapped 5% (conn): Connecting to a relay
Oct 06 19:05:51 tomato Tor[107220]: Bootstrapped 10% (conn_done): Connected to a relay
Oct 06 19:05:52 tomato Tor[107220]: Bootstrapped 14% (handshake): Handshaking with a relay
Oct 06 19:05:52 tomato Tor[107220]: Bootstrapped 15% (handshake_done): Handshake with a relay done
Oct 06 19:05:52 tomato Tor[107220]: Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to buil>
Oct 06 19:05:52 tomato Tor[107220]: Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay t>
Oct 06 19:05:52 tomato Tor[107220]: Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Oct 06 19:05:53 tomato Tor[107220]: Bootstrapped 100% (done): Done
Oct 06 19:06:50 tomato systemd[1]: tor.service: start operation timed out. Terminating.
Oct 06 19:06:50 tomato Tor[107220]: Interrupt: exiting cleanly.
Oct 06 19:06:50 tomato systemd[1]: tor.service: Failed with result 'timeout'.
Oct 06 19:06:50 tomato systemd[1]: Failed to start Anonymizing overlay network for TCP.
Oct 06 19:06:51 tomato systemd[1]: tor.service: Scheduled restart job, restart counter is at 26.
Oct 06 19:06:51 tomato systemd[1]: Stopped Anonymizing overlay network for TCP.

* link to upstream bug report, if any

Steps to reproduce:
Bug was introduced with changes in service file /usr/lib/systemd/system/tor.service in tor-0.4.4.5-2
This task depends upon

Closed by  freswa (frederik)
Wednesday, 07 October 2020, 11:38 GMT
Reason for closing:  Fixed
Additional comments about closing:  tor-0.4.4.5-3 in [community-testing]

Comment by Disinfectant Injector (Dinjector) - Wednesday, 07 October 2020, 00:26 GMT
diff --git a/usr/lib/systemd/system/tor.service b/etc/systemd/system/tor.service
index fd30443..49e9753 100644
--- a/usr/lib/systemd/system/tor.service
+++ b/etc/systemd/system/tor.service
@@ -9,15 +9,13 @@ Description=Anonymizing overlay network for TCP
After=syslog.target network.target nss-lookup.target

[Service]
-Type=notify
-NotifyAccess=all
+Type=simple
ExecStartPre=/usr/bin/tor -f /etc/tor/torrc --verify-config
ExecStart=/usr/bin/tor -f /etc/tor/torrc
ExecReload=/bin/kill -HUP ${MAINPID}
KillSignal=SIGINT
TimeoutSec=60
Restart=on-failure
-WatchdogSec=1m
LimitNOFILE=32768

# Hardening
Comment by loqs (loqs) - Wednesday, 07 October 2020, 00:33 GMT
 FS#66762 

checking for SYSTEMD... no
configure: Okay, checking for systemd a different way...
checking for SYSTEMD... no
Comment by Disinfectant Injector (Dinjector) - Wednesday, 07 October 2020, 00:44 GMT
Does this mean that tor was not built with support for sd-notify, and fixing  FS#66762  would allow tor to work with the supplied service file and properly notify systemd when it starts?
Comment by loqs (loqs) - Wednesday, 07 October 2020, 00:50 GMT
Yes. .BUILDINFO from tor-0.4.4.5-2-x86_64.pkg.tar.zst only contains installed = systemd-libs-246.6-1-x86_64
Building in a clean chroot produces the output I posted. A depends or makedepends on systemd would address the issue without  FS#66762  being fixed.
Comment by freswa (frederik) - Wednesday, 07 October 2020, 11:25 GMT
Please check tor-0.4.4.5-3 in [community-testing]

Loading...