Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tor No Longer Starting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
necron
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 95

PostPosted: Wed Aug 02, 2017 4:46 am    Post subject: Tor No Longer Starting Reply with quote

Anybody have any ideas what I'm doing wrong?

Starting with the minimal config file that comes with the ebuild gives these results:
Code:
 # /etc/init.d/tor start
 * Caching service dependencies ...                                       [ ok ]
 * Starting tor ...
 * start-stop-daemon: failed to start `/usr/bin/tor'
 * Failed to start tor                                                    [ !! ]
 * ERROR: tor failed to start


Code:
 tor
Aug 01 21:38:24.099 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.0.2k and Zlib 1.2.11.
Aug 01 21:38:24.100 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Aug 01 21:38:24.100 [notice] Read configuration file "/etc/tor/torrc".
Aug 01 21:38:24.106 [notice] Opening Socks listener on 127.0.0.1:9050


Using a custom config file gives me the following:

Code:
 * Starting tor ...
Aug 01 21:45:39.000 [warn] Can't log to stdout with RunAsDaemon set; skipping stdout
 * start-stop-daemon: failed to start `/usr/bin/tor'
 * Failed to start tor                                                    [ !! ]
 * ERROR: tor failed to start


Code:
 tor
Aug 01 21:44:44.881 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.0.2k and Zlib 1.2.11.
Aug 01 21:44:44.881 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Aug 01 21:44:44.881 [notice] Read configuration file "/etc/tor/torrc".
Aug 01 21:44:44.885 [notice] Your ContactInfo config option is not set. Please consider setting it, so we can contact you if your server is misconfigured or something else goes wrong.
Aug 01 21:44:44.885 [notice] Based on detected system memory, MaxMemInQueues is set to 2878 MB. You can override this by setting MaxMemInQueues by hand.
Aug 01 21:44:44.885 [warn] Tor is running as an exit relay. If you did not want this behavior, please set the ExitRelay option to 0. If you do want to run an exit Relay, please set the ExitRelay option to 1 to disable this warning, and for forward compatibility.
Aug 01 21:44:44.885 [notice] Opening Socks listener on 127.0.0.1:9050
Aug 01 21:44:44.885 [notice] Opening Control listener on 127.0.0.1:9051
Aug 01 21:44:44.886 [notice] Opening OR listener on 0.0.0.0:9001
Aug 01 21:44:44.886 [notice] Opening Directory listener on 0.0.0.0:9030
Aug 01 21:44:44.000 [warn] Error while parsing configuration: Excess data after quoted string
Aug 01 21:44:44.000 [err] set_options(): Bug: Acting on config options left us in a broken state. Dying. (on Tor 0.3.0.8 802d30d9b71a6d54)
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3647
Location: Hamburg

PostPosted: Wed Aug 02, 2017 6:54 am    Post subject: Reply with quote

Code:
Aug 01 21:44:44.000 [warn] Error while parsing configuration: Excess data after quoted string
Overlooked this message ? ;)
Try this too:
Code:
/etc/init.d/tor check_config
Back to top
View user's profile Send private message
necron
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 95

PostPosted: Wed Aug 02, 2017 8:53 am    Post subject: Reply with quote

I get the start-stop-daemon error whether or not I'm using a torrc file that generates those messages about parsing. And checkconfig doesn't do anything. Downgrading tor and booting into a different kernel doesn't seem to make a difference either.
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 402
Location: Somewhere in Denmark

PostPosted: Wed Aug 02, 2017 3:28 pm    Post subject: Reply with quote

You could try enable debug-logging in the torrc.

Same version works fine here:
Code:
Aug 02 17:11:59 [Tor] Tor 0.3.0.8 (git-802d30d9b71a6d54) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.0.2k and Zlib 1.2.11._
Aug 02 17:11:59 [Tor] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning_
Aug 02 17:11:59 [Tor] Read configuration file "/etc/tor/torrc"._
Aug 02 17:11:59 [Tor] Your ContactInfo config option is not set. Please consider setting it, so we can contact you if your server is misconfigured or something else goes wrong._
Aug 02 17:11:59 [Tor] Based on detected system memory, MaxMemInQueues is set to 2941 MB. You can override this by setting MaxMemInQueues by hand._
Aug 02 17:11:59 [Tor] Opening Socks listener on 127.0.0.1:9050_
Aug 02 17:11:59 [Tor] Opening Control listener on 127.0.0.1:9051_
Aug 02 17:11:59 [Tor] Opening OR listener on 0.0.0.0:2001_
Aug 02 17:11:59 [Tor] Opening Directory listener on 0.0.0.0:2030_
Aug 02 17:11:59 [Tor] Parsing GEOIP IPv4 file /usr/share/tor/geoip._
Aug 02 17:12:00 [Tor] Parsing GEOIP IPv6 file /usr/share/tor/geoip6._
Aug 02 17:12:00 [Tor] Configured to measure statistics. Look for the *-stats files that will first be written to the data directory in 24 hours from now._
Aug 02 17:12:02 [Tor] Your Tor server's identity key fingerprint is 'torvlhdk 2820B118C141F8008F857EA7597033D6DE6F83C3'_
Aug 02 17:12:02 [Tor] Bootstrapped 0%: Starting_
Aug 02 17:12:43 [Tor] Starting with guard context "default"_
Aug 02 17:12:43 [Tor] Bootstrapped 80%: Connecting to the Tor network_
Aug 02 17:12:45 [Tor] Bootstrapped 85%: Finishing handshake with first hop_
Aug 02 17:12:45 [Tor] Bootstrapped 90%: Establishing a Tor circuit_
Aug 02 17:12:45 [Tor] Tor has successfully opened a circuit. Looks like client functionality is working._
Aug 02 17:12:45 [Tor] Bootstrapped 100%: Done_
Aug 02 17:12:45 [Tor] Now checking whether ORPort 90.184.239.156:2001 and DirPort 90.184.239.156:2030 are reachable... (this may take up to 20 minutes -- look for log messages indicating success)_
Aug 02 17:12:45 [Tor] Self-testing indicates your ORPort is reachable from the outside. Excellent._
Aug 02 17:12:46 [Tor] Self-testing indicates your DirPort is reachable from the outside. Excellent. Publishing server descriptor._
Aug 02 17:12:48 [Tor] Performing bandwidth self-test...done._
Aug 02 17:14:28 [Tor] Interrupt: we have stopped accepting new connections, and will shut down in 30 seconds. Interrupt again to exit now._
Aug 02 17:14:32 [Tor] SIGINT received a second time; exiting now._
Back to top
View user's profile Send private message
necron
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 95

PostPosted: Wed Aug 02, 2017 8:22 pm    Post subject: Reply with quote

Here is the result of the debug messages from issuing 'tor' and '/etc/init.d/tor start' in that order:

Code:
Aug 02 13:14:57.000 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) opening new log file.
Aug 02 13:14:57.832 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.0.2k and Zlib 1.2.11.
Aug 02 13:14:57.832 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Aug 02 13:14:57.832 [notice] Read configuration file "/etc/tor/torrc".
Aug 02 13:14:57.836 [notice] Your ContactInfo config option is not set. Please consider setting it, so we can contact you if your server is misconfigured or something else goes wrong.
Aug 02 13:14:57.836 [notice] Based on detected system memory, MaxMemInQueues is set to 2878 MB. You can override this by setting MaxMemInQueues by hand.
Aug 02 13:14:57.837 [notice] Opening Socks listener on 127.0.0.1:9050
Aug 02 13:14:57.837 [notice] Opening Control listener on 127.0.0.1:9051
Aug 02 13:14:57.837 [notice] Opening OR listener on 0.0.0.0:9001
Aug 02 13:14:57.837 [notice] Opening Directory listener on 0.0.0.0:9030
Aug 02 13:14:57.000 [warn] Your log may contain sensitive information - you're logging more than "notice". Don't log unless it serves an important reason. Overwrite the log afterwards.
Aug 02 13:14:57.000 [info] options_act_reversible(): Recomputed OOS thresholds: ConnLimit 1000, ConnLimit_ 4064, ConnLimit_high_thresh 4000, ConnLimit_low_thresh 3048
Aug 02 13:14:57.000 [debug] tor_disable_debugger_attach(): Attemping to disable debugger attachment to Tor for unprivileged users.
Aug 02 13:14:57.000 [debug] tor_disable_debugger_attach(): Debugger attachment disabled for unprivileged users.
Aug 02 13:14:57.000 [info] tor_lockfile_lock(): Locking "/var/lib/tor/data/lock"
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 128.31.0.39:9131 (9695)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 86.59.21.38:80 (847B)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 194.109.206.212:80 (7EA6)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 16 dirserver at 37.218.247.217:80 (1D8F)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 131.188.40.189:80 (F204)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 193.23.244.244:80 (7BE6)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 171.25.193.9:443 (BD6A)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 154.35.175.225:80 (CF6D)
Aug 02 13:14:57.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 199.254.238.52:80 (74A9)
Aug 02 13:14:57.000 [debug] file_status(): stat()ing /var/lib/tor/data/state
Aug 02 13:14:57.000 [warn] Error while parsing configuration: Excess data after quoted string
Aug 02 13:14:57.000 [err] set_options(): Bug: Acting on config options left us in a broken state. Dying. (on Tor 0.3.0.8 802d30d9b71a6d54)

Code:

Aug 02 13:15:10.000 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) opening log file.
Aug 02 13:15:10.000 [warn] Can't log to stdout with RunAsDaemon set; skipping stdout
Aug 02 13:15:10.000 [warn] Can't log to stdout with RunAsDaemon set; skipping stdout
Aug 02 13:15:10.000 [warn] Your log may contain sensitive information - you're logging more than "notice". Don't log unless it serves an important reason. Overwrite the log afterwards.
Aug 02 13:15:10.000 [info] options_act_reversible(): Recomputed OOS thresholds: ConnLimit 1000, ConnLimit_ 29968, ConnLimit_high_thresh 29904, ConnLimit_low_thresh 22476
Aug 02 13:15:10.000 [debug] tor_disable_debugger_attach(): Attemping to disable debugger attachment to Tor for unprivileged users.
Aug 02 13:15:10.000 [debug] tor_disable_debugger_attach(): Debugger attachment disabled for unprivileged users.
Aug 02 13:15:10.000 [info] tor_lockfile_lock(): Locking "/var/lib/tor/data/lock"
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 128.31.0.39:9131 (9695)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 86.59.21.38:80 (847B)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 194.109.206.212:80 (7EA6)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 16 dirserver at 37.218.247.217:80 (1D8F)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 131.188.40.189:80 (F204)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 193.23.244.244:80 (7BE6)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 171.25.193.9:443 (BD6A)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 154.35.175.225:80 (CF6D)
Aug 02 13:15:10.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 199.254.238.52:80 (74A9)
Aug 02 13:15:10.000 [debug] file_status(): stat()ing /var/lib/tor/data/state
Aug 02 13:15:10.000 [warn] Error while parsing configuration: Excess data after quoted string
Aug 02 13:15:10.000 [err] set_options(): Bug: Acting on config options left us in a broken state. Dying. (on Tor 0.3.0.8 802d30d9b71a6d54)


And to reiterate, I know that Tor is complaining about the torrc file being screwed up but switching it out with the minimal torrc still causes Tor to die.
Back to top
View user's profile Send private message
necron
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 95

PostPosted: Wed Aug 02, 2017 8:35 pm    Post subject: Reply with quote

Here's the debug output with a minimal torrc (without the complaints about parsing the file written to stdout). It still seems to complain about being unable to parse the torrc file, in the debug output.

Code:
tor

Code:
Aug 02 13:31:21.000 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) opening log file.
Aug 02 13:31:21.280 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.0.2k and Zlib 1.2.11.
Aug 02 13:31:21.280 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Aug 02 13:31:21.280 [notice] Read configuration file "/etc/tor/torrc".
Aug 02 13:31:21.286 [notice] Opening Socks listener on 127.0.0.1:9050
Aug 02 13:31:21.000 [warn] Your log may contain sensitive information - you're logging more than "notice". Don't log unless it serves an important reason. Overwrite the log afterwards.
Aug 02 13:31:21.000 [info] options_act_reversible(): Recomputed OOS thresholds: ConnLimit 1000, ConnLimit_ 4064, ConnLimit_high_thresh 4000, ConnLimit_low_thresh 3048
Aug 02 13:31:21.000 [debug] tor_disable_debugger_attach(): Attemping to disable debugger attachment to Tor for unprivileged users.
Aug 02 13:31:21.000 [debug] tor_disable_debugger_attach(): Debugger attachment disabled for unprivileged users.
Aug 02 13:31:21.000 [info] tor_lockfile_lock(): Locking "/var/lib/tor/data/lock"
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 128.31.0.39:9131 (9695)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 86.59.21.38:80 (847B)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 194.109.206.212:80 (7EA6)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 16 dirserver at 37.218.247.217:80 (1D8F)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 131.188.40.189:80 (F204)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 193.23.244.244:80 (7BE6)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 171.25.193.9:443 (BD6A)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 154.35.175.225:80 (CF6D)
Aug 02 13:31:21.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 199.254.238.52:80 (74A9)
Aug 02 13:31:21.000 [debug] file_status(): stat()ing /var/lib/tor/data/state
Aug 02 13:31:21.000 [warn] Error while parsing configuration: Excess data after quoted string
Aug 02 13:31:21.000 [err] set_options(): Bug: Acting on config options left us in a broken state. Dying. (on Tor 0.3.0.8 802d30d9b71a6d54)


Code:
/etc/init.d/tor start

Code:
Aug 02 13:34:20.000 [notice] Tor 0.3.0.8 (git-802d30d9b71a6d54) opening log file.
Aug 02 13:34:20.000 [warn] Your log may contain sensitive information - you're logging more than "notice". Don't log unless it serves an important reason. Overwrite the log afterwards.
Aug 02 13:34:20.000 [info] options_act_reversible(): Recomputed OOS thresholds: ConnLimit 1000, ConnLimit_ 29968, ConnLimit_high_thresh 29904, ConnLimit_low_thresh 22476
Aug 02 13:34:20.000 [debug] tor_disable_debugger_attach(): Attemping to disable debugger attachment to Tor for unprivileged users.
Aug 02 13:34:20.000 [debug] tor_disable_debugger_attach(): Debugger attachment disabled for unprivileged users.
Aug 02 13:34:20.000 [info] tor_lockfile_lock(): Locking "/var/lib/tor/data/lock"
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 128.31.0.39:9131 (9695)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 86.59.21.38:80 (847B)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 194.109.206.212:80 (7EA6)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 16 dirserver at 37.218.247.217:80 (1D8F)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 131.188.40.189:80 (F204)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 193.23.244.244:80 (7BE6)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 171.25.193.9:443 (BD6A)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 154.35.175.225:80 (CF6D)
Aug 02 13:34:20.000 [debug] parse_dir_authority_line(): Trusted 100 dirserver at 199.254.238.52:80 (74A9)
Aug 02 13:34:20.000 [debug] file_status(): stat()ing /var/lib/tor/data/state
Aug 02 13:34:20.000 [warn] Error while parsing configuration: Excess data after quoted string
Aug 02 13:34:20.000 [err] set_options(): Bug: Acting on config options left us in a broken state. Dying. (on Tor 0.3.0.8 802d30d9b71a6d54)



torrc
Code:
#
# Minimal torrc so tor will work out of the box
#
User tor
PIDFile /var/run/tor/tor.pid
Log notice syslog
Log debug file /var/log/tor/debug.log
DataDirectory /var/lib/tor/data
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 402
Location: Somewhere in Denmark

PostPosted: Thu Aug 03, 2017 4:05 pm    Post subject: Reply with quote

You've tried recreating the torrc-file(s)?
As toralf pointed out this
Code:
Aug 02 13:31:21.000 [warn] Error while parsing configuration: Excess data after quoted string
doesn't look good and might be the cause of this
Code:
Aug 02 13:31:21.000 [err] set_options(): Bug: Acting on config options left us in a broken state. Dying. (on Tor 0.3.0.8 802d30d9b71a6d54)


What happens if you use the provided torrc.sample? (maybe with Log debug set to get more output)
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1692

PostPosted: Thu Aug 03, 2017 8:48 pm    Post subject: Reply with quote

One thing you should check and be careful on, is the non-shown characters that may be at the end of the lines (like spaces and tabs and others).
This can also be a factor on the editor you are using to save the file, as it may be be adding (CR and LF at end of the lines or something). I know I tested the default/basic file and tor started up fine, even with the debug statement in it; but I used vim and not some GUI text/word editor.
Back to top
View user's profile Send private message
necron
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 95

PostPosted: Thu Aug 03, 2017 11:46 pm    Post subject: Reply with quote

I don't think that I've ever used anything except for Vim to edit config files. Vim is too damned good.

freke wrote:

What happens if you use the provided torrc.sample? (maybe with Log debug set to get more output)

Exact same thing.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1692

PostPosted: Fri Aug 04, 2017 2:12 am    Post subject: Reply with quote

A couple things to help narrow it down, is to first check the /etc/tor/torrc-defaults file and make sure there isn't anything strange in that file.

The other thing you could do, is when you try running tor, is try running it yourself (instead of starting it's service) and use the -f option and specify the config file.
My thinking on this is that the service is possibly reading a different config file than we are expecting. By manually specifying the config file, we force it to use a specific one.

https://www.torproject.org/docs/tor-manual.html.en
According to tor's manual online, it looks for a config file in the config for the system (i.e. /etc/tor/) and also in the user's home directory.
It also references the torrc-defaults file for option that wasn't set in the config file.
Back to top
View user's profile Send private message
necron
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2010
Posts: 95

PostPosted: Fri Aug 04, 2017 2:44 am    Post subject: Reply with quote

The logs seem to indicate that it's reading /etc/tor/torrc. I do not have any /etc/tor/torrc-defaults file though.

Code:
ls
torrc  torrcold  torrc.sample  torsocks.conf


As for running tor without its service, do you mean just calling it from the command line instead of its initscript? Because I've tried both, to the exact same effect.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum