Opened 6 years ago

Last modified 2 years ago

#9213 new defect

Shouldn't ~/.torrc override /etc/torrc ?

Reported by: hsn Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.4.13-alpha
Severity: Normal Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

if you want to run multiple tor instances on machine then tor should prefer configuration in user home over system wide torrc as documented in man page:

(Default: $HOME/.torrc, or /usr/local/etc/tor/torrc if that file is not found

from ktrace tor reads /usr/local/etc/tor/torrc-defaults first (this is good) but then do not search for .torrc in user $HOME and loads system wide torrc which will fail because other copy of tor is already running.

96532 initial thread NAMI  "/usr/local/etc/tor/torrc-defaults"
96532 initial thread NAMI  "/usr/local/etc/tor/torrc-defaults"
96532 initial thread NAMI  "/usr/local/etc/tor/torrc"
96532 initial thread NAMI  "/usr/local/etc/tor/torrc"
96532 initial thread NAMI  "/usr/local/etc/tor/torrc"

Child Tickets

Change History (11)

comment:1 Changed 6 years ago by arma

I think this counts as not-a-bug, or at least not a bug in Tor. Tor searches for wherever you told it at compile-time that it should look. If it's looking in /usr/local/etc/tor, that sounds like you built it yourself. Give it some different options to ./configure and it will look somewhere else.

Or said another way, if you want Tor to look somewhere other than where you compiled it to look, that's why the -f option is there.

comment:2 Changed 6 years ago by hsn

It should do:

  1. torrc-defaults
  2. use home .torrc
  3. system wide torrc

as documented in man page. it picks system wide torrc over file in user $HOME.

comment:3 Changed 6 years ago by arma

Oh hey, you're right. The man page is currently wrong.

We should either fix the man page or fix the behavior.

comment:4 Changed 6 years ago by arma

Milestone: Tor: 0.2.5.x-final

comment:5 Changed 6 years ago by hsn

fix code

comment:6 Changed 6 years ago by nickm

Keywords: tor-client added

comment:7 Changed 6 years ago by nickm

Changing the behavior of the code will break some people's configurations in order to fix others. We should do the manpage fix in 0.2.5, and consider other fixes later.

comment:8 Changed 6 years ago by nickm

Keywords: 025-triaged added

triage: fix documentation in 0.2.5, and consider behavior changes for later version.

comment:9 Changed 6 years ago by nickm

Status: newneeds_review

The documentation fix is in bug9213_doc_024.

comment:10 Changed 6 years ago by nickm

Keywords: 025-triaged removed
Milestone: Tor: 0.2.5.x-finalTor: unspecified
Status: needs_reviewnew

Merged the documentation fix to maint-0.2.4 and master. This ticket is now about letting ~/.torrc override @confdir@/torrc

comment:11 Changed 2 years ago by nickm

Severity: Normal
Summary: configuration files used in wrong orderShouldn't ~/.torrc override /etc/torrc ?
Note: See TracTickets for help on using tickets.