parent
a29f7534ee
commit
20cbac9752
|
@ -316,13 +316,23 @@ class Main:
|
|||
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
||||
|
||||
def daemonize(self):
|
||||
try:
|
||||
if os.fork():
|
||||
exit(0)
|
||||
except AttributeError:
|
||||
# fork not implemented
|
||||
pass
|
||||
else:
|
||||
shared.thisapp.lock() # relock
|
||||
os.umask(0)
|
||||
os.setsid()
|
||||
try:
|
||||
if os.fork():
|
||||
exit(0)
|
||||
except AttributeError:
|
||||
# fork not implemented
|
||||
pass
|
||||
else:
|
||||
shared.thisapp.lock() # relock
|
||||
shared.thisapp.lockPid = None # indicate we're the final child
|
||||
sys.stdout.flush()
|
||||
|
|
Loading…
Reference in New Issue
Block a user