<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi Tim!</div>

<div>Thank you for your knowledgeable support.</div>

<div>I could nail it down to the missing systemd support in the Tor version I compiled from the sources.</div>

<div>After re-compiling it with './configure --enable-systemd' it works again as expected...</div>

<div> </div>

<div>Above that, I was able to eliminate the 'Permissions [...] are too permissive.' warning by adding 'RelaxDirModeCheck' to the ControlSocket definition.</div>

<div> </div>

<div>Thank you again!</div>

<div> </div>

<div>Best Regards, Ralph</div>

<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Donnerstag, 28. Dezember 2017 um 12:36 Uhr<br/>
<b>Von:</b> teor <teor2345@gmail.com><br/>
<b>An:</b> tor-relays@lists.torproject.org<br/>
<b>Betreff:</b> Re: [tor-relays] Debian Stretch (Raspbian): Tor daemon fails to complete launching procedure, endless cycling.</div>

<div><br/>
> On 28 Dec 2017, at 21:39, Ralph Wetzel <theonionbox@gmx.com> wrote:<br/>
><br/>
> Hi there!<br/>
> I took the advantage of some family time to update my Tor Relay to the latest RPi Raspbian release (based on Debian Stretch).<br/>
> The Pi does nothing else than running a Tor node, so no 'customized' configuration or settings are necessary / applied at all.<br/>
> Even after installation of the latest tor package (as usual: apt-get install tor) everything looked fine... until I encountered, that the tor daemon failed to launch automatically.<br/>
><br/>
> Doing some investigation, I found this [0] info reporting an issue with the systemd setup of Tor on latest Debian / Unbutu and followed the proposed procedure: After renaming 'tor.service' and a 'sudo systemctl daemon-reload' the system then tried to launch the 'tor@default' service - named being 'the correct one'. So far so fine.<br/>
<br/>
This works fine without modification on my Debian and Ubuntu boxes.<br/>
<br/>
If I want to see the status of individual tor instances, I use:<br/>
<br/>
systemctl status tor@(instance)<br/>
<br/>
If I want to see the status of all my tor instances, I use:<br/>
<br/>
systemctl status tor@*<br/>
<br/>
If I want to do something to all my tor instances, I use:<br/>
<br/>
systemctl (action) tor<br/>
<br/>
This is not related to your other issue.<br/>
<br/>
> The BIG YET is, that the daemon now fails to finish it's starting sequence. More precisely, a minute (or less) after bootstrapping reaches 100%, the daemon receives (out of nothing!) an interrupt - and the cycle restarts:<br/>
<br/>
The tor daemon should notify systemd when it finishes launching.<br/>
This is so systemd knows that it hasn't hung.<br/>
<br/>
So either systemd is misconfigured, or your tor is compiled without<br/>
systemd support.<br/>
<br/>
If tor is compiled with systemd support, it should log one of the<br/>
following messages:<br/>
<br/>
Unable to send readiness to systemd<br/>
Signaled readiness to systemd<br/>
systemd NOTIFY_SOCKET not present<br/>
<br/>
I can't see any of these in your log, but it might be earlier than the<br/>
part you sent.<br/>
<br/>
The last message is logged at info level.<br/>
(It's also less likely to be the issue.)<br/>
To see info level logs, add this line to your torrc:<br/>
<br/>
Log info file /path/to/log/file<br/>
<br/>
(I don't know where your log file is.<br/>
But it's probably at /var/log/tor/log.)<br/>
<br/>
> Dec 28 11:27:03.000 [notice] Bootstrapped 100%: Done<br/>
> ...<br/>
> Dec 28 11:28:49.000 [notice] Interrupt: we have stopped accepting new connections, and will shut down in 30 seconds. Interrupt again to exit now.<br/>
> Dec 28 11:29:19.000 [notice] Clean shutdown finished. Exiting.<br/>
<br/>
This looks like systemd killed tor due to a notify failure.<br/>
<br/>
> ...<br/>
><br/>
> Before, there's only the one warning that looks a bit strange - but (to my guessing) should have nothing to do with the issue encountered:<br/>
><br/>
> Dec 28 11:27:58.000 [warn] Permissions on directory /var/run/tor are too permissive.<br/>
> Dec 28 11:27:58.000 [warn] Before Tor can create a control socket in "/var/run/tor/control", the directory "/var/run/tor" needs to exist, and to be accessible only by the user and group account that is running Tor. (On some Unix systems, anybody who can list a socket can connect to it, so Tor is being careful.)<br/>
<br/>
See below.<br/>
<br/>
> Above that, 'service tor@default status' gives a status that is different from what I've seen so far:<br/>
><br/>
> ● tor@default.service - Anonymizing overlay network for TCP<br/>
> Loaded: loaded (/lib/systemd/system/tor@default.service; static; vendor preset: enabled)<br/>
> Active: activating (start) since Thu 2017-12-28 11:23:48 CET; 32s ago<br/>
> Process: 1078 ExecStartPre=/usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 --verify<br/>
> Process: 1076 ExecStartPre=/usr/bin/install -Z -m 02755 -o debian-tor -g debian-tor -d /var/run/tor (code=exited, status=0/SUCCESS)<br/>
<br/>
This looks like your torrc and systemd unit file are out of sync.<br/>
<br/>
The unit file sets /var/run/tor as group-readable.<br/>
But the torrc entry for that socket doesn't seem to have RelaxDirModeCheck<br/>
(and typically the socket itself gets GroupWritable, because that's the<br/>
point of making the directory group-readable).<br/>
<br/>
> Main PID: 1082 (tor)<br/>
> CGroup: /system.slice/system-tor.slice/tor@default.service<br/>
> └─1082 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0<br/>
><br/>
> I used to get an 'active (running) since ...' status, whereas now it stays at 'activating (start) since ...' - which technically is correct!<br/>
<br/>
Back to the notify issue.<br/>
This looks like systemd has not seen a notify from tor.<br/>
<br/>
> Therefore - I need some help:<br/>
><br/>
> 1) Can someone confirm that the Tor systemd configuration is broken as [0] states?<br/>
<br/>
No, that user's expectations don't match the actual Tor systemd config.<br/>
It works fine, when you use it right.<br/>
<br/>
> 2) If 1) is confirmed, is the solution offered by [0] the right way to solve the issue?<br/>
<br/>
The solution will not solve your issue.<br/>
<br/>
> 3) What else shall I do? If already described somewhere, a link will be highly appreciated.<br/>
<br/>
Log at info level so you know exactly what has gone wrong with systemd<br/>
notifications.<br/>
<br/>
If your tor doesn't log anything about systemd when it starts, you can<br/>
install a tor that is compiled with systemd support, and it should work.<br/>
<br/>
If you can't do that, you can tell systemd not to expect a notification.<br/>
You can use a systemd drop-in file with "Type=simple" in it. I don't<br/>
know of any instructions to do this, but here is the manual:<br/>
<br/>
<a href="https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=" target="_blank">https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=</a><br/>
<br/>
T<br/>
<br/>
> [0] <a href="https://askubuntu.com/questions/882527/tor-process-will-not-start-automatically-on-ubuntu-16-04" target="_blank">https://askubuntu.com/questions/882527/tor-process-will-not-start-automatically-on-ubuntu-16-04</a><br/>
<br/>
--<br/>
Tim / teor<br/>
<br/>
PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B<br/>
ricochet:ekmygaiu4rzgsk6n<br/>
------------------------------------------------------------------------<br/>
<br/>
_______________________________________________<br/>
tor-relays mailing list<br/>
tor-relays@lists.torproject.org<br/>
<a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays" target="_blank">https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays</a></div>
</div>
</div>

<div> </div>

<div class="signature"> </div></div></body></html>