From 68eaa680f84eef84cbc5c688d2d37325710d33bf Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 16 May 2023 12:28:59 +0000 Subject: [PATCH] CLI/RPC: better error msg when running daemon on Windows `-d` is not supported, due to missing os.fork related: https://github.com/spesmilo/electrum/issues/5511 --- run_electrum | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run_electrum b/run_electrum index aaf6ea161..0f32d954f 100755 --- a/run_electrum +++ b/run_electrum @@ -419,7 +419,13 @@ def main(): print_stderr("Run 'electrum stop' to stop the daemon.") sys.exit(1) # fork before creating the asyncio event loop - pid = os.fork() + try: + pid = os.fork() + except AttributeError as e: + print_stderr(f"Error: {e!r}") + print_stderr("Running daemon in detached mode (-d) is not supported on this platform.") + print_stderr("Try running the daemon in the foreground (without -d).") + sys.exit(1) if pid: print_stderr("starting daemon (PID %d)" % pid) sys.exit(0)