[PATCH] * Fixed inherit fd issue for process module.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 func/minion/modules/process.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/func/minion/modules/process.py b/func/minion/modules/process.py
index 80e76fd..d4d9eee 100644
--- a/func/minion/modules/process.py
+++ b/func/minion/modules/process.py
@@ -40,7 +40,7 @@ class ProcessModule(func_module.FuncModule):
         cmd = sub_process.Popen(["/bin/ps", flags], executable="/bin/ps",
                                 stdout=sub_process.PIPE,
                                 stderr=sub_process.PIPE,
-                                shell=False)
+                                shell=False, close_fds=True)

         data, error = cmd.communicate()

@@ -209,14 +209,16 @@ class ProcessModule(func_module.FuncModule):
         if signal[0] != "-":
             signal = "-%s" % signal
         rc = sub_process.call(["/bin/kill",signal, pid],
-                              executable="/bin/kill", shell=False)
+                              executable="/bin/kill", shell=False,
+                              close_fds=True)
         print rc
         return rc

     def pkill(self,name,level=""):
         # example killall("thunderbird","-9")
         rc = sub_process.call(["/usr/bin/pkill", name, level],
-                              executable="/usr/bin/pkill", shell=False)
+                              executable="/usr/bin/pkill", shell=False,
+                              close_fds=True)
         return rc

     def register_method_args(self):
-- 
1.5.6.5

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux