commit 5f29017c9d1cb14c5fe3d2d28129c02e23bcca1a
parent 98cc9c53d1c05001380da57f43a6f5815632fbbc
Author: ThomasV <thomasv@gitorious>
Date: Thu, 2 Apr 2015 12:12:18 +0200
pass config.path to daemon (exemptore). fixes #901
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git 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
@@ -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()