Windows daemon mode workaround
This commit is contained in:
parent
cfa84cf81a
commit
aaa5e9d309
|
@ -349,12 +349,13 @@ class Main:
|
||||||
shared.thisapp.lockPid = None # indicate we're the final child
|
shared.thisapp.lockPid = None # indicate we're the final child
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
si = file(os.devnull, 'r')
|
if not sys.platform.startswith('win'):
|
||||||
so = file(os.devnull, 'a+')
|
si = file(os.devnull, 'r')
|
||||||
se = file(os.devnull, 'a+', 0)
|
so = file(os.devnull, 'a+')
|
||||||
os.dup2(si.fileno(), sys.stdin.fileno())
|
se = file(os.devnull, 'a+', 0)
|
||||||
os.dup2(so.fileno(), sys.stdout.fileno())
|
os.dup2(si.fileno(), sys.stdin.fileno())
|
||||||
os.dup2(se.fileno(), sys.stderr.fileno())
|
os.dup2(so.fileno(), sys.stdout.fileno())
|
||||||
|
os.dup2(se.fileno(), sys.stderr.fileno())
|
||||||
|
|
||||||
def setSignalHandler(self):
|
def setSignalHandler(self):
|
||||||
signal.signal(signal.SIGINT, helper_generic.signal_handler)
|
signal.signal(signal.SIGINT, helper_generic.signal_handler)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user