[tor-commits] [stem/master] Providing '__ReloadTorrcOnSIGHUP 0' when lauching tor with a custom config

atagar at torproject.org atagar at torproject.org
Sun Dec 9 07:14:15 UTC 2012


commit aebe936d6e3f6a62d3d5f70944f06d599c207475
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Dec 8 23:11:24 2012 -0800

    Providing '__ReloadTorrcOnSIGHUP 0' when lauching tor with a custom config
    
    Lauching tor with the '__ReloadTorrcOnSIGHUP 0' option when we provide it with
    a custom configuration. This is to prevent the process from erring out when it
    gets a sighup due to not having a torrc.
    
    Suggestion by Robert on...
    
    https://trac.torproject.org/7682
---
 stem/process.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/stem/process.py b/stem/process.py
index e043010..6696821 100644
--- a/stem/process.py
+++ b/stem/process.py
@@ -196,7 +196,10 @@ def launch_tor_with_config(config, tor_cmd = "tor", completion_percent = 100, in
           for value in values:
             torrc_file.write("%s %s\n" % (key, value))
     
-    return launch_tor(tor_cmd, None, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership)
+    # prevents tor from erroring out due to a missing torrc if it gets a sighup
+    args = ['--__ReloadTorrcOnSIGHUP', '0']
+    
+    return launch_tor(tor_cmd, args, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership)
   finally:
     try: os.remove(torrc_path)
     except: pass



More information about the tor-commits mailing list