Browse Source

Enable/disable if tor should run in daemon mode

Each node now has a 'daemon' argument which can be set to True
or False.
Steven Engler 4 years ago
parent
commit
a4869a8550
2 changed files with 5 additions and 1 deletions
  1. 4 0
      lib/chutney/TorNet.py
  2. 1 1
      torrc_templates/common.i

+ 4 - 0
lib/chutney/TorNet.py

@@ -1038,6 +1038,7 @@ DEFAULTS = {
     'hs': False,
     'hs_directory': 'hidden_service',
     'hs-hostname': None,
+    'daemon': True,
     'connlimit': 60,
     'net_base_dir': get_absolute_net_path(),
     'tor': os.environ.get('CHUTNEY_TOR', 'tor'),
@@ -1208,6 +1209,9 @@ class TorEnviron(chutney.Templating.Environ):
     def _get_valgrind_log(self, my):
         return os.path.join(self['dir'], 'valgrind.log')
 
+    def _get_daemon_int(self, my):
+        return 1 if self['daemon'] else 0
+
     # A hs generates its key on first run,
     # so check for it at the last possible moment,
     # but cache it in memory to avoid repeatedly reading the file

+ 1 - 1
torrc_templates/common.i

@@ -30,7 +30,7 @@ TestingMinExitFlagThreshold 0
 
 ## Options that we always want to test ##
 DataDirectory $dir
-RunAsDaemon 1
+RunAsDaemon $daemon_int
 ConnLimit $connlimit
 Nickname $nick
 # Let tor close connections gracefully before exiting