Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#3550 closed defect (fixed)

--quiet flag doesn't prevent default log to stdout in options_validate()

Reported by: atagar Owned by:
Priority: Low Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi, the man page for the quiet flag says:
"Do not start Tor with a console log unless explicitly requested to do so."

however this doesn't work...
23:58 < atagar> hm, tor's --quiet flag doesn't seem to work (running "tor --quiet -f /path/to/torrc" with http://pastebin.com/LfAbHG4i still logs to the terminal)
05:45 < Sebastian> atagar: --quiet only works if you specify an alternative location for the log
05:45 < Sebastian> like a file
05:45 < Sebastian> atagar: file a bug if you care

I don't care about this too much (found it on accident) but probably something we should fix.

Child Tickets

Change History (10)

comment:1 Changed 9 years ago by arma

Huh? It works for me.

arma@last-request:~/old/torgit/tor$ src/or/tor --quiet
arma@last-request:~/old/torgit/tor$ src/or/tor --quiet -f /usr/local/etc/tor/torrc
arma@last-request:~/old/torgit/tor$ src/or/tor --quiet -f /usr/local/etc/tor/notexit
arma@last-request:~/old/torgit/tor$

What does it do for you?

comment:2 Changed 9 years ago by atagar

Nope. Thought it might be a version issue but no luck with v0.2.2.23-alpha or 0.2.3.1-alpha-dev).

atagar@fenrir:~/Desktop/tor/torGit/tor/src/or$ ./tor --quiet
Jul 08 12:37:53.000 [notice] Parsing GEOIP file /usr/local/share/tor/geoip.
Jul 08 12:37:54.000 [notice] Configured to measure statistics. Look for the *-stats files that will first be written to the data directory in 24 hours from now.
Jul 08 12:37:54.000 [notice] OpenSSL OpenSSL 0.9.8g 19 Oct 2007 [90807f] looks like it's older than 0.9.8l, but some vendors have backported 0.9.8l's renegotiation code to earlier versions, and some have backported the code from 0.9.8m or 0.9.8n.  I'll set both SSL3_FLAGS and SSL_OP just to be safe.
Jul 08 12:37:54.000 [notice] This version of Tor (0.2.3.1-alpha-dev) is newer than any recommended version, according to the directory authorities. Recommended versions are: 0.2.1.29,0.2.1.30,0.2.2.21-alpha,0.2.2.22-alpha,0.2.2.23-alpha,0.2.2.24-alpha,0.2.2.25-alpha,0.2.2.26-beta,0.2.2.27-beta,0.2.2.28-beta,0.2.2.29-beta,0.2.3.1-alpha
Jul 08 12:37:54.000 [notice] Reloaded microdescriptor cache.  Found 0 descriptors.
^CJul 08 12:37:55.000 [notice] We now have enough directory information to build circuits.
Jul 08 12:37:55.000 [notice] Bootstrapped 80%: Connecting to the Tor network.
Jul 08 12:37:55.000 [notice] Interrupt: exiting cleanly.
atagar@fenrir:~/Desktop/tor/torGit/tor/src/or$ ./tor --quiet -f ~/.tor/torrc_client 
Jul 08 12:36:38.000 [notice] Parsing GEOIP file /usr/local/share/tor/geoip.
Jul 08 12:36:38.000 [notice] Configured to measure statistics. Look for the *-stats files that will first be written to the data directory in 24 hours from now.
Jul 08 12:36:38.000 [notice] OpenSSL OpenSSL 0.9.8g 19 Oct 2007 [90807f] looks like it's older than 0.9.8l, but some vendors have backported 0.9.8l's renegotiation code to earlier versions, and some have backported the code from 0.9.8m or 0.9.8n.  I'll set both SSL3_FLAGS and SSL_OP just to be safe.
Jul 08 12:36:39.000 [notice] This version of Tor (0.2.3.1-alpha-dev) is newer than any recommended version, according to the directory authorities. Recommended versions are: 0.2.1.29,0.2.1.30,0.2.2.21-alpha,0.2.2.22-alpha,0.2.2.23-alpha,0.2.2.24-alpha,0.2.2.25-alpha,0.2.2.26-beta,0.2.2.27-beta,0.2.2.28-beta,0.2.2.29-beta,0.2.3.1-alpha
Jul 08 12:36:39.000 [notice] Reloaded microdescriptor cache.  Found 0 descriptors.
^CJul 08 12:36:40.000 [notice] We now have enough directory information to build circuits.
Jul 08 12:36:40.000 [notice] Bootstrapped 80%: Connecting to the Tor network.
Jul 08 12:36:40.000 [notice] Interrupt: exiting cleanly.

comment:3 Changed 9 years ago by arma

Perhaps you have a "log notice stdout" line in your torrc?

comment:4 Changed 9 years ago by atagar

Maybe in the first example but in the second all it has is:

ControlPort 9051
CookieAuthentication 1

Iirc the log entry is a special one in that Tor adds "log notice stdout" if none is supplied to the configuration (there was another ticket about this a while back), hence making the --quiet flag nonfunctional unless you explicitly supply your own log torrc entry to suppress the default. Though just a guess, I haven't hunted through the Tor source yet.

comment:5 Changed 9 years ago by arma

Milestone: Tor: 0.2.3.x-final
Summary: --quiet flag largely nonfunctional--quiet flag doesn't prevent default log to stdout in options_validate()

confirmed

comment:6 Changed 8 years ago by nickm

Status: newneeds_review

The plot thickens: --quiet does seem to work with stuff like --list-fingerprint and --hash-password.

A little poking shows that the log is added in options_init_logs(), when it adds the log handler for the entry added in options_validate. It doesn't look at the "quiet" value at all when it does this.

Easiest way to solve this AFAICT is to make the quiet level a global and have it change the behavior of options_validate().

Have a look at branch bug3550 in my public repository?

comment:7 Changed 8 years ago by atagar

I tested your bug3550 with the aforementioned use case and it did the trick - thanks!

comment:8 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

great ; merging it. Thanks for testing it out!

comment:9 Changed 7 years ago by nickm

Keywords: tor-client added

comment:10 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.