RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1036049 - [tuned] SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf" should be reversed
Summary: [tuned] SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf" should be reversed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tuned
Version: 6.6
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Tereza Cerna
URL:
Whiteboard:
Depends On:
Blocks: 1075802 1159926
TreeView+ depends on / blocked
 
Reported: 2013-11-29 09:35 UTC by Jiri Belka
Modified: 2019-07-11 07:48 UTC (History)
16 users (show)

Fixed In Version: tuned-0.2.19-15.el6
Doc Type: Bug Fix
Doc Text:
On Red Hat Enterprise Linux 6, the /etc/sysctl.conf file is the default configuration file for the sysctl tool settings and overrides can be specified in the /etc/sysctl.d/ directory. The tuned service previously handled the settings the opposite way, which is common in certain distributions. Consequently, the configuration specified in /etc/sysctl.d/ could be overridden by /etc/sysctl.conf. The way tuned handles /etc/sysctl.conf and /etc/sysctl.d/ has been reversed to match the Red Hat Enterprise Linux 6 logic. As a result, /etc/sysctl.conf is now processed first and can be overridden by settings in /etc/sysctl.d/.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:14:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1376 0 normal SHIPPED_LIVE tuned bug fix update 2015-07-20 17:58:39 UTC

Description Jiri Belka 2013-11-29 09:35:24 UTC
Description of problem:
SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf" should be reversed. I belived it should be reverse because it should go from implicit to explicit, that is from "defaults" to "overriden" valued in sysctl.d subdir.

Found this hard when /etc/sysctl.d/ovirt-engine.conf sysctl values where again overriden.

Some apps could put their sysctl settings into sysctl.d subdir, thus those values should always win.

Version-Release number of selected component (if applicable):
tuned-0.2.19-13.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. modify as below:
# grep kernel.shmmax /etc/sysctl.conf /etc/sysctl.d/*
/etc/sysctl.conf:##kernel.shmmax = 68719476736
/etc/sysctl.conf:kernel.shmmax = 30000000
/etc/sysctl.d/ovirt-engine.conf:kernel.shmmax = 41943040
2. install tuned
3. reboot

Actual results:
values defined in files in sysctl.d dir are again overriden by ktuned RC script because of order (SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf") defined in /etc/sysconfig/ktune

Expected results:
values defined in files in sysctl.d dir should always win! (switch order in /etc/sysconfig/ktune)

Additional info:
functions file has valid ordering of sysctl conf files processing, thus why ktune reverses the order?

# sed -n '/^apply/,/^$/p' /etc/init.d/functions 
apply_sysctl() {
    sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
    for file in /etc/sysctl.d/* ; do
        is_ignored_file "$file" && continue
        test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1
    done
}

Comment 1 Jiri Belka 2013-11-29 09:41:34 UTC
Just for archives, RHEVM sysctl stuff - BZ1027605.

Comment 3 RHEL Program Management 2013-12-02 15:54:16 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 Jaroslav Škarvada 2013-12-03 16:58:42 UTC
Hmm, by checking /etc/init.d/functions:apply_sysctl it does seem that RHEL-6 uses reverse order than other distros (including current Fedora) do. We need to be consistent with the init script, thus giving dev_ack+

Comment 5 Jaroslav Škarvada 2013-12-03 17:02:52 UTC
Side note: /etc/sysctl.conf is deprecated in current Fedora (F20) and supported by symlink: /etc/sysctl.d/99-sysctl.conf -> ../sysctl.conf

Comment 14 Tereza Cerna 2015-03-16 11:47:15 UTC
==============================
Verified in version:
    tuned-0.2.19-15.el6.noarch
PASSED
============================== 

# cat /etc/sysconfig/ktune | grep SYSCTL_POST
SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"

# cat /etc/sysctl.conf | grep kernel.shmmax
#kernel.shmmax = 4294967295
kernel.shmmax = 20000000

# cat /etc/sysctl.d/aaa.conf
kernel.shmmax = 30000000

== reboot == 

# tuned-adm profile virtual-guest

# sysctl kernel.shmmax
kernel.shmmax = 30000000

# grep SYSCTL_POST= `rpm -ql tuned` | grep -v \#
/etc/sysconfig/ktune:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/default/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/desktop-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/enterprise-storage/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/laptop-ac-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/laptop-battery-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/latency-performance/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/server-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/spindown-disk/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/throughput-performance/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/virtual-guest/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/etc/tune-profiles/virtual-host/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"
/usr/share/doc/tuned-0.2.19/README.ktune:    SYSCTL_POST="/etc/sysctl.conf /etc/sysctl.d/*"

==================================
Reproduced in version:
    tuned-0.2.19-13.el6_6.1.noarch
FAIL
==================================

# cat /etc/sysconfig/ktune | grep SYSCTL_POST
SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"

# cat /etc/sysctl.conf | grep kernel.shmmax
#kernel.shmmax = 4294967295
kernel.shmmax = 20000000

# cat /etc/sysctl.d/aaa.conf
kernel.shmmax = 30000000

== reboot == 

# tuned-adm profile virtual-guest

# sysctl kernel.shmmax
kernel.shmmax = 20000000

# grep SYSCTL_POST= `rpm -ql tuned` | grep -v \#
/etc/sysconfig/ktune:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/default/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/desktop-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/enterprise-storage/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/laptop-ac-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/laptop-battery-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/latency-performance/ktune.sysconfig:SYSCTL_POST="/etc/syctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/server-powersave/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/spindown-disk/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/throughput-performance/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/virtual-guest/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/etc/tune-profiles/virtual-host/ktune.sysconfig:SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"
/usr/share/doc/tuned-0.2.19/README.ktune:    SYSCTL_POST="/etc/sysctl.d/* /etc/sysctl.conf"

Comment 15 errata-xmlrpc 2015-07-22 07:14:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1376.html


Note You need to log in before you can comment on or make changes to this bug.