refactor: improve shutdown error messages

This commit is contained in:
tecnovert
2026-03-17 09:03:21 +02:00
committed by nahuhh
parent f668c38cd6
commit f577f84f09
2 changed files with 9 additions and 7 deletions

View File

@@ -1757,15 +1757,15 @@ def printHelp():
def finalise_daemon(d):
logging.info("Interrupting {}".format(d.handle.pid))
logging.info(f"Interrupting {d.name} {d.handle.pid}")
try:
d.handle.send_signal(signal.CTRL_C_EVENT if os.name == "nt" else signal.SIGINT)
d.handle.wait(timeout=120)
for fp in [d.handle.stdout, d.handle.stderr, d.handle.stdin] + d.files:
if fp:
fp.close()
except Exception as e:
logging.info(f"Error {e} for process {d.handle.pid}")
for fp in [d.handle.stdout, d.handle.stderr, d.handle.stdin] + d.files:
if fp:
fp.close()
logging.info(f"Error stopping {d.name}, process {d.handle.pid}: {e}")
def test_particl_encryption(data_dir, settings, chain, use_tor_proxy, extra_opts):