Skip to content
Snippets Groups Projects
Commit 433291d6 authored by Pavel Kácha's avatar Pavel Kácha
Browse files

Close descriptors later to catch additional potential errors

parent 85eaf2aa
No related branches found
No related tags found
No related merge requests found
......@@ -432,10 +432,6 @@ def daemonize(
os.close(fd)
except Exception:
pass
# Redirect stdin, stdout, stderr to /dev/null
devnull = os.open(os.devnull, os.O_RDWR)
for fd in range(3):
os.dup2(devnull, fd)
# PID file
if pidfile is not None:
pidd = os.open(pidfile, os.O_RDWR | os.O_CREAT | os.O_EXCL | os.O_TRUNC)
......@@ -449,6 +445,10 @@ def daemonize(
os.unlink(pidfile)
except Exception:
pass
# Redirect stdin, stdout, stderr to /dev/null
devnull = os.open(os.devnull, os.O_RDWR)
for fd in range(3):
os.dup2(devnull, fd)
def save_events(aggr, filer):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment