From 7a4551e1e72ce5ffd6fc359437435c077103e027 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 30 Jul 2017 09:36:20 +0200 Subject: [PATCH] Fix signal handler in daemon mode - signal handler requires the main thread to run --- src/bitmessagemain.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 4a7227e9..388a6068 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -27,6 +27,7 @@ import socket import ctypes from struct import pack from subprocess import call +from time import sleep from api import MySimpleXMLRPCRequestHandler, StoppableXMLRPCServer from helper_startup import isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections @@ -315,6 +316,10 @@ class Main: else: BMConfigParser().remove_option('bitmessagesettings', 'dontconnect') + if daemon: + while state.shutdown == 0: + sleep(1) + def daemonize(self): try: if os.fork():