Fix closing of stdin/out/err in forked process

parent 81e574be
......@@ -43,6 +43,13 @@ class Supervisor:
logger.error("stdout: %s", self.process.stdout.readline())
logger.error("stderr: %s", self.process.stderr.readline())
# dettach stdin/out/err and close them
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, 0)
os.dup2(devnull, 1)
os.dup2(devnull, 2)
os.close(devnull)
os._exit(0)
def run_proc(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment