Fix signal handler in daemon mode

- signal handler requires the main thread to run
This commit is contained in:
Peter Šurda 2017-07-30 09:36:20 +02:00
parent 3e6de7a9ad
commit 7a4551e1e7
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
1 changed files with 5 additions and 0 deletions

View File

@ -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():