From 5f29017c9d1cb14c5fe3d2d28129c02e23bcca1a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 2 Apr 2015 12:12:18 +0200 Subject: [PATCH] pass config.path to daemon (exemptore). fixes #901 --- electrum | 1 + lib/daemon.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/electrum b/electrum index 229886b4f..ae1fa0cd4 100755 --- a/electrum +++ b/electrum @@ -276,6 +276,7 @@ if __name__ == '__main__': network.start() if arg == 'status': print_json({ + 'path': network.config.path, 'server': network.get_parameters()[0], 'blockchain_height': network.get_local_height(), 'server_height': network.get_server_height(), diff --git a/lib/daemon.py b/lib/daemon.py index ab41d50f0..41611f971 100644 --- a/lib/daemon.py +++ b/lib/daemon.py @@ -35,8 +35,9 @@ DAEMON_SOCKET = 'daemon.sock' def do_start_daemon(config): import subprocess + args = [sys.executable, __file__, config.path] logfile = open(os.path.join(config.path, 'daemon.log'),'w') - p = subprocess.Popen([sys.executable,__file__], stderr=logfile, stdout=logfile, close_fds=(os.name=="posix")) + p = subprocess.Popen(args, stderr=logfile, stdout=logfile, close_fds=(os.name=="posix")) print_stderr("starting daemon (PID %d)"%p.pid) @@ -207,7 +208,10 @@ def daemon_loop(server): if __name__ == '__main__': import simple_config, util - config = simple_config.SimpleConfig() + _config = {} + if len(sys.argv) > 1: + _config['electrum_path'] = sys.argv[1] + config = simple_config.SimpleConfig(_config) util.set_verbosity(True) server = NetworkServer(config) server.start()