cores: Set working dir to datadir for daemons.

This commit is contained in:
tecnovert 2021-12-10 16:29:00 +02:00
parent 6590481b9f
commit 001e9976aa
No known key found for this signature in database
GPG Key ID: 8ED6D8750C4E3F93
2 changed files with 13 additions and 7 deletions

View File

@ -39,22 +39,23 @@ def signal_handler(sig, frame):
def startDaemon(node_dir, bin_dir, daemon_bin, opts=[]):
daemon_bin = os.path.expanduser(os.path.join(bin_dir, daemon_bin))
args = [daemon_bin, '-datadir=' + os.path.expanduser(node_dir)] + opts
datadir_path = os.path.expanduser(node_dir)
args = [daemon_bin, '-datadir=' + datadir_path] + opts
logging.info('Starting node ' + daemon_bin + ' ' + '-datadir=' + node_dir)
return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=datadir_path)
def startXmrDaemon(node_dir, bin_dir, daemon_bin, opts=[]):
daemon_bin = os.path.expanduser(os.path.join(bin_dir, daemon_bin))
data_dir = os.path.expanduser(node_dir)
args = [daemon_bin, '--non-interactive', '--config-file=' + os.path.join(data_dir, 'monerod.conf')] + opts
datadir_path = os.path.expanduser(node_dir)
args = [daemon_bin, '--non-interactive', '--config-file=' + os.path.join(datadir_path, 'monerod.conf')] + opts
logging.info('Starting node {} --data-dir={}'.format(daemon_bin, node_dir))
# return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
file_stdout = open(os.path.join(data_dir, 'core_stdout.log'), 'w')
file_stderr = open(os.path.join(data_dir, 'core_stderr.log'), 'w')
return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=file_stdout, stderr=file_stderr)
file_stdout = open(os.path.join(datadir_path, 'core_stdout.log'), 'w')
file_stderr = open(os.path.join(datadir_path, 'core_stderr.log'), 'w')
return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=file_stdout, stderr=file_stderr, cwd=datadir_path)
def startXmrWalletDaemon(node_dir, bin_dir, wallet_bin, opts=[]):

View File

@ -1,4 +1,9 @@
0.0.x
==============
- Set working dir to datadir for daemons.
0.0.27
==============