From: Ondrej Lichtner <olichtne(a)redhat.com>
When creating a subprocess using the subprocess.Popen method, the newly
created process inherits the file descriptors of the parent by default.
This includes the server socket on the Slave machines which can cause
problems if the slave starts a daemon process (for example ovs-vswitchd)
that is not stopped when lnst-slave dies.
This commit fixes that.
---
lnst/Common/ExecCmd.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Common/ExecCmd.py b/lnst/Common/ExecCmd.py
index 31f3759..d6c92c6 100644
--- a/lnst/Common/ExecCmd.py
+++ b/lnst/Common/ExecCmd.py
@@ -50,7 +50,7 @@ def exec_cmd(cmd, die_on_err=True, log_outputs=True,
report_stderr=False):
cmd = cmd.rstrip(" ")
logging.debug("Executing: \"%s\"" % cmd)
subp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ stderr=subprocess.PIPE, close_fds=True)
(data_stdout, data_stderr) = subp.communicate()
'''
--
1.8.5.3
Show replies by date