From: JINMEI Tatuya Date: Thu, 11 Oct 2012 21:03:58 +0000 (-0700) Subject: [1858] explicitly set close_fds to True in sockcreator's Popen(). X-Git-Tag: trac2402_base~28^2^2~1^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92f2cc51478005befb016e410a4fcb9c768ea3b8;p=thirdparty%2Fkea.git [1858] explicitly set close_fds to True in sockcreator's Popen(). --- diff --git a/src/lib/python/isc/bind10/sockcreator.py b/src/lib/python/isc/bind10/sockcreator.py index c681d07fee..55142eeda4 100644 --- a/src/lib/python/isc/bind10/sockcreator.py +++ b/src/lib/python/isc/bind10/sockcreator.py @@ -214,9 +214,14 @@ class Creator(Parser): socket.SOCK_STREAM) env = copy.deepcopy(os.environ) env['PATH'] = path + # We explicitly set close_fs to True; it's False by default before + # Python 3.2. If we don't close the remaining FDs, the copy of + # 'local' will prevent the child process from terminating when + # the parent process died abruptly. self.__process = subprocess.Popen(['b10-sockcreator'], env=env, stdin=remote.fileno(), stdout=remote2.fileno(), + close_fds=True, preexec_fn=self.__preexec_work) remote.close() remote2.close()