Linux 7.0a4 broken after update: "Directory /run/user/$uid/Tor does not exist."
After Tor Browser 7.0a3 is updated to 7.0a4 on Linux, it fails to start up. The problem is that the code we wrote for legacy/trac#20761 (moved) to remove
SocksPort lines from the user's torrc only removes Unix domain socket lines if the browser is configured to use Unix domain sockets, which it is not in 7.0a4. This means that after updating to 7.0a4, Tor Launcher starts tor so that TCP is used for the control port and SOCKS port, but lines like the following are left behind in torrc:
ControlPort unix:/run/user/1001/Tor/control.socket SocksPort unix:/run/user/1001/Tor/socks.socket IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth
Unfortunately, the parent directory (in this example,
/run/user/1001/Tor) does not exist because Tor Launcher removes it when it exits and does not create it because it does not think Unix domain sockets are being used.
A similar problem occurs on OSX, but the parent directory is always
.../TorBrowser-Data/Tor which happens to exist for other reasons (i.e., that's where torrc is located), so on OSX Tor Browser starts up and there are both TCP and Unix domain socket listeners.
One workaround is for users to edit their torrc and remove the
SocksPort lines manually.