[tor-commits] [oonib/master] Set Tor DataDir in startTor
art at torproject.org
art at torproject.org
Wed Sep 11 09:13:51 UTC 2013
commit 31bfac043a400d218a812e7dc190ea804e9c6137
Author: aagbsn <aagbsn at extc.org>
Date: Wed Jul 3 10:19:24 2013 +0200
Set Tor DataDir in startTor
Tor's DataDir should be set before starting Tor so that
descriptors are cached rather than downloaded each time.
---
oonib/runner.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/oonib/runner.py b/oonib/runner.py
index a6b479f..edd1b6b 100644
--- a/oonib/runner.py
+++ b/oonib/runner.py
@@ -47,14 +47,6 @@ def setupCollector(tor_process_protocol):
os.makedirs(tempfile.gettempdir())
_temp_dir = tempfile.mkdtemp()
- if config.main.tor_datadir is None:
- log.warn("Option 'tor_datadir' in oonib.conf is unspecified!")
- log.msg("Creating tmp directory in current directory for datadir.")
- log.debug("Using %s" % _temp_dir)
- datadir = _temp_dir
- else:
- datadir = config.main.tor_datadir
-
torconfig = TorConfig(tor_process_protocol.tor_protocol)
public_port = 80
# XXX there is currently a bug in txtorcon that prevents data_dir from
@@ -75,6 +67,14 @@ def startTor():
if config.main.tor2webmode:
torconfig.Tor2webMode = 1
torconfig.CircuitBuildTimeout = 60
+ if config.main.tor_datadir is None:
+ log.warn("Option 'tor_datadir' in oonib.conf is unspecified!")
+ log.msg("Creating tmp directory in current directory for datadir.")
+ log.debug("Using %s" % _temp_dir)
+ datadir = _temp_dir
+ else:
+ datadir = config.main.tor_datadir
+ torconfig.DataDirectory = datadir
torconfig.save()
if config.main.tor_binary is not None:
d = launch_tor(torconfig, reactor,
More information about the tor-commits
mailing list