Fix signal handler in daemon mode
- signal handler requires the main thread to run
This commit is contained in:
parent
3e6de7a9ad
commit
7a4551e1e7
|
@ -27,6 +27,7 @@ import socket
|
||||||
import ctypes
|
import ctypes
|
||||||
from struct import pack
|
from struct import pack
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
from api import MySimpleXMLRPCRequestHandler, StoppableXMLRPCServer
|
from api import MySimpleXMLRPCRequestHandler, StoppableXMLRPCServer
|
||||||
from helper_startup import isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections
|
from helper_startup import isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections
|
||||||
|
@ -315,6 +316,10 @@ class Main:
|
||||||
else:
|
else:
|
||||||
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
||||||
|
|
||||||
|
if daemon:
|
||||||
|
while state.shutdown == 0:
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
def daemonize(self):
|
def daemonize(self):
|
||||||
try:
|
try:
|
||||||
if os.fork():
|
if os.fork():
|
||||||
|
|
Reference in New Issue
Block a user