Blob Blame History Raw
diff --git a/tuned/plugins/plugin_script.py b/tuned/plugins/plugin_script.py
index 28c361a..c1cad1c 100644
--- a/tuned/plugins/plugin_script.py
+++ b/tuned/plugins/plugin_script.py
@@ -42,7 +42,7 @@ class ScriptPlugin(tuned.plugins.Plugin):
 		for script in self._scripts:
 			log.info("Calling script %s" % (script))
 			try:
-				proc = Popen([script, arg], stdout=PIPE, stderr=PIPE)
+				proc = Popen([script, arg], stdout=PIPE, stderr=PIPE, close_fds=True)
 				out, err = proc.communicate()
 
 				if proc.returncode:
diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py
index 6eace81..a1b2eeb 100644
--- a/tuned/plugins/plugin_sysctl.py
+++ b/tuned/plugins/plugin_sysctl.py
@@ -44,9 +44,9 @@ class SysctlPlugin(tuned.plugins.Plugin):
 	def _exec_sysctl(self, data, write = False):
 		if write:
 			log.debug("Setting sysctl: %s" % (data))
-			proc = Popen(["/sbin/sysctl", "-q", "-w", data], stdout=PIPE, stderr=PIPE)
+			proc = Popen(["/sbin/sysctl", "-q", "-w", data], stdout=PIPE, stderr=PIPE, close_fds=True)
 		else:
-			proc = Popen(["/sbin/sysctl", "-e", data], stdout=PIPE, stderr=PIPE)
+			proc = Popen(["/sbin/sysctl", "-e", data], stdout=PIPE, stderr=PIPE, close_fds=True)
 		out, err = proc.communicate()
 
 		if proc.returncode:
diff --git a/tuned/utils/nettool.py b/tuned/utils/nettool.py
index 676efca..28fdf89 100644
--- a/tuned/utils/nettool.py
+++ b/tuned/utils/nettool.py
@@ -57,13 +57,13 @@ class Nettool:
 		if not self.supported_autoneg:
 			return False
 
-		return 0 == call(["ethtool", "-s", self._interface, "autoneg", "on" if enable else "off"])
+		return 0 == call(["ethtool", "-s", self._interface, "autoneg", "on" if enable else "off"], close_fds=True)
 
 	def _set_advertise(self, value):
 		if not self._set_autonegotiation(True):
 			return False
 
-		return 0 == call(["ethtool", "-s", self._interface, "advertise", "0x%03x" % value])
+		return 0 == call(["ethtool", "-s", self._interface, "advertise", "0x%03x" % value], close_fds=True)
 
 	def get_max_speed(self):
 		max = 0
@@ -113,8 +113,8 @@ class Nettool:
 
 		# run ethtool and preprocess output
 
-		p_ethtool = Popen(["ethtool", self._interface], stdout=PIPE, stderr=PIPE)
-		p_filter = Popen(["sed", "s/^\s*//;s/:\s*/:\\n/g"], stdin=p_ethtool.stdout, stdout=PIPE)
+		p_ethtool = Popen(["ethtool", self._interface], stdout=PIPE, stderr=PIPE, close_fds=True)
+		p_filter = Popen(["sed", "s/^\s*//;s/:\s*/:\\n/g"], stdin=p_ethtool.stdout, stdout=PIPE, close_fds=True)
 
 		output = p_filter.communicate()[0]
 		errors = p_ethtool.communicate()[1]