[tor-relays] Tor not starting but log inconclusive

yl tor at yl.ms
Tue Dec 14 20:26:21 UTC 2021


Hello,
as there were some follow up emails let me explain the problem.

The standard Debian tor at default.service has "After=network.target 
nss-lookup.target" in it, so one would think network should be fully 
functional when the services starts, but it was not in my case.
At the time when tor started the eno0 did not yet have a IPv6, so it 
complained that it could not bind to some port in the config, because 
the IP supplied with the port was not ready yet.

The after that 5 retries to start tor it gets stuck, systemd status 
tells it is running, but nyx can says it is not running.

After the 5 restarts I saw that ifup had some issue too, which was 
caused by some config in /etc/network/interfaces, which was working ok 
and the IPv6 was also reachable, but still the ifup at eno0.service was not 
working well. I have no idea about how and where to find that service.

However, I changed the "network" parameter in the interfaces config to 
be supplied with the IPv6, so like 2001:0DB8:0001::0002/64 instead of 
"network 64" in a separate line.
This satisfied ifup it seems, but still it was too slow to be up and 
running before Tor was started.

Then I searched again and found a quick and dirty (aka lazy) solution 
for that, in "tor at default.service" I added this line:

ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'

in the "[Service]" section.

I also tried to add "network-online.target" and some "ifup at eno0.service" 
in the "After=" line above, but I guess it must be somehow different, 
maybe has to be some target instead.

So with this line a ping of google.com has to work at least once for the 
service to be started. In combination with the standard 
"TimeoutStartSec=300" that should work well.

I am sure there is nicer solutions, but why bother.

yours
yl


More information about the tor-relays mailing list