mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-10 20:22:36 +01:00
We apparently need these closes as well. Let's see if this fixes my bug.
This commit is contained in:
parent
5542ad9e92
commit
bbc5ed6058
@ -286,6 +286,14 @@ if __name__ == '__main__':
|
||||
sys.stderr.close()
|
||||
sys.stdout = StringIO.StringIO()
|
||||
sys.stderr = StringIO.StringIO()
|
||||
# We have to be really methodical here.
|
||||
os.close(0)
|
||||
os.close(1)
|
||||
os.close(2)
|
||||
fd = os.open('/dev/null', os.RDWR)
|
||||
os.dup2(fd, 0)
|
||||
os.dup2(fd, 1)
|
||||
os.dup2(fd, 2)
|
||||
signal.signal(signal.SIGHUP, signal.SIG_IGN)
|
||||
log.info('Completed daemonization. Current PID: %s', os.getpid())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user