commit 16ab367e290ed0aeb97afc39ce85aaa9eaf91de8
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu Mar 27 13:09:24 2014 +0100
ExecCmd: exec_cmd processes should close fds
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.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/ExecCmd.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
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()
'''
Show replies by date