Blame SOURCES/tuned-2.11.0-reapply-sysctl-ignore-usr.patch

04124f
From 14053bc98adfa7f57e7a3ec61ddb1b7b36a7200e Mon Sep 17 00:00:00 2001
04124f
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
04124f
Date: Wed, 27 Nov 2019 12:20:36 +0100
04124f
Subject: [PATCH] sysctl: Make reapply_sysctl ignore configs from /usr
04124f
MIME-Version: 1.0
04124f
Content-Type: text/plain; charset=UTF-8
04124f
Content-Transfer-Encoding: 8bit
04124f
04124f
The reapply_sysctl functionality was originally added to address
04124f
rhbz#1302953, which was about Tuned overriding sysctl config files
04124f
from /etc, which was deemed undesirable. The bug said nothing about
04124f
sysctl config files from /usr/lib/sysctl.d, /lib/sysctl.d or
04124f
/usr/local/lib/sysctl.d.
04124f
04124f
Having sysctl configs from /usr override Tuned profiles causes
04124f
problems (rhbz#1759597). Also, it seems reasonable for Tuned profiles
04124f
to override sysctl configs from /usr - a Tuned profile is often
04124f
explicitly chosen by the user, whereas sysctl configs from /usr are
04124f
provided by system packages whether the user wants them or not.
04124f
04124f
Also, in RHEL-6, tuned used to ignore sysctl config files from /usr,
04124f
as far as I can tell.
04124f
04124f
Resolves rhbz#1759597
04124f
04124f
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
04124f
---
04124f
 man/tuned-main.conf.5          | 16 ++++++++--------
04124f
 tuned-main.conf                |  7 ++++---
04124f
 tuned/plugins/plugin_sysctl.py |  5 +----
04124f
 3 files changed, 13 insertions(+), 15 deletions(-)
04124f
04124f
diff --git a/man/tuned-main.conf.5 b/man/tuned-main.conf.5
04124f
index 9418d258..1c8dba70 100644
04124f
--- a/man/tuned-main.conf.5
04124f
+++ b/man/tuned-main.conf.5
04124f
@@ -61,14 +61,14 @@ applicable if \fBdaemon\fR is enabled. By default it's set to \fBTrue\fR.
04124f
 
04124f
 .TP
04124f
 .BI reapply_sysctl= BOOL
04124f
-This controls whether to reapply sysctl settings from the \fI/etc/sysctl.conf\fR,
04124f
-\fI/etc/sysctl.d/*.conf\fR, \fI/usr/lib/sysctl.d/*.conf\fR,
04124f
-\fI/usr/local/lib/sysctl.d/*.conf\fR, \fI/lib/sysctl.d/*.conf\fR,
04124f
-\fI/run/sysctl.d/*.conf\fR, i.e. all locations supported by
04124f
-\fBsysctl --system\fR after Tuned sysctl settings are applied, i.e. if
04124f
-set to \fBTrue\fR or \fB1\fR Tuned sysctl settings will not override system
04124f
-sysctl settings. If set to \fBFalse\fR or \fB0\fR Tuned sysctl settings will
04124f
-override system sysctl settings. By default it's set to \fBTrue\fR.
04124f
+This controls whether to reapply sysctl settings from \fI/run/sysctl.d/*.conf\fR,
04124f
+\fI/etc/sysctl.d/*.conf\fR and \fI/etc/sysctl.conf\fR after Tuned sysctl
04124f
+settings are applied. These are locations supported by \fBsysctl --system\fR,
04124f
+excluding those that contain sysctl configuration files provided by system packages.
04124f
+So if \fBreapply_sysctl\fR is set to \fBTrue\fR or \fB1\fR, Tuned sysctl settings
04124f
+will not override user-provided system sysctl settings. If set to \fBFalse\fR or
04124f
+\fB0\fR, Tuned sysctl settings will override system sysctl settings. By default
04124f
+it's set to \fBTrue\fR.
04124f
 
04124f
 .TP
04124f
 .BI default_instance_priority= INT
04124f
diff --git a/tuned-main.conf b/tuned-main.conf
04124f
index 6d060e59..40c4be25 100644
04124f
--- a/tuned-main.conf
04124f
+++ b/tuned-main.conf
04124f
@@ -22,9 +22,10 @@ update_interval = 10
04124f
 # one hardcoded profile (by default "balanced").
04124f
 recommend_command = 1
04124f
 
04124f
-# Whether to reapply sysctl from the e.g /etc/sysctl.conf, /etc/sysctl.d, ...
04124f
-# If enabled these sysctls will be re-appliead after Tuned sysctls are
04124f
-# applied, i.e. Tuned sysctls will not override system sysctls.
04124f
+# Whether to reapply sysctl from /run/sysctl.d/, /etc/sysctl.d/ and
04124f
+# /etc/sysctl.conf.  If enabled, these sysctls will be re-appliead
04124f
+# after Tuned sysctls are applied, i.e. Tuned sysctls will not
04124f
+# override user-provided system sysctls.
04124f
 reapply_sysctl = 1
04124f
 
04124f
 # Default priority assigned to instances
04124f
diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py
04124f
index b298bfa8..ee7596d5 100644
04124f
--- a/tuned/plugins/plugin_sysctl.py
04124f
+++ b/tuned/plugins/plugin_sysctl.py
04124f
@@ -12,10 +12,7 @@
04124f
 
04124f
 DEPRECATED_SYSCTL_OPTIONS = [ "base_reachable_time", "retrans_time" ]
04124f
 SYSCTL_CONFIG_DIRS = [ "/run/sysctl.d",
04124f
-		"/etc/sysctl.d",
04124f
-		"/usr/local/lib/sysctl.d",
04124f
-		"/usr/lib/sysctl.d",
04124f
-		"/lib/sysctl.d" ]
04124f
+		"/etc/sysctl.d" ]
04124f
 
04124f
 class SysctlPlugin(base.Plugin):
04124f
 	"""