Bug 1315847 - /etc/init.d/function applies sysctl in wrong order.
Summary: /etc/init.d/function applies sysctl in wrong order.
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-08 18:44 UTC by Shatadru Bandyopadhyay
Modified: 2019-10-10 11:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-09 08:07:48 UTC
Target Upstream Version:


Attachments (Terms of Use)
patch (513 bytes, patch)
2016-03-08 18:44 UTC, Shatadru Bandyopadhyay
no flags Details | Diff

Description Shatadru Bandyopadhyay 2016-03-08 18:44:13 UTC
Created attachment 1134273 [details]
patch

Description of problem:
/etc/init.d/function applies sysctl in wrong order.

It first applies /etc/sysctl.conf and then /etc/sysctl.d/*.conf

However sysctl --system does it in different order :
~~~
              /run/sysctl.d/*.conf
              /etc/sysctl.d/*.conf
              /usr/local/lib/sysctl.d/*.conf
              /usr/lib/sysctl.d/*.conf
              /lib/sysctl.d/*.conf
              /etc/sysctl.conf
~~~

This causes inconsistency in the order how sysctl are applied at system boot.

Version-Release number of selected component (if applicable):
initscripts-9.03.49-1.el6_7.4.x86_64

How reproducible:
Always.

Steps to Reproduce:

1. Set a same sysctl parameter in /etc/sysctl.conf and in configuration file under /etc/sysctl.d/*.conf.

Taking example of "net.ipv4.tcp_keepalive_time"
  ~~~
  # cat /etc/sysctl.conf|grep keep
  net.ipv4.tcp_keepalive_time = 999

  # cat /etc/sysctl.d/99.conf|grep keep
  net.ipv4.tcp_keepalive_time = 666


  # sysctl --system
  * Applying /etc/sysctl.d/99.conf ...
  net.ipv4.tcp_keepalive_time = 666
  * Applying /etc/sysctl.conf ...
  net.ipv4.tcp_keepalive_time = 999

  # sysctl net.ipv4.tcp_keepalive_time
  net.ipv4.tcp_keepalive_time = 999

2. Reboot the system
 # sysctl net.ipv4.tcp_keepalive_time
  net.ipv4.tcp_keepalive_time = 666<<======

3. Running "sysctl --system" of course scans all config file in proper order and sets expected value.
   
   # sysctl --system
   # sysctl net.ipv4.tcp_keepalive_time
    net.ipv4.tcp_keepalive_time = 999

Actual results:

after system boots 

 # sysctl net.ipv4.tcp_keepalive_time
  net.ipv4.tcp_keepalive_time = 666<<======



Expected results:

after system boots

 # sysctl net.ipv4.tcp_keepalive_time
  net.ipv4.tcp_keepalive_time = 999


Additional info:

1. patch attached

2. Issue is not reproducible if "NetworkManager" is installed and enabled at boot, as it only reads /etc/sysctl.conf and when it is started at boot it overrides the settings.

Comment 1 Lukáš Nykrýn 2016-03-09 08:07:48 UTC
Yeah, this is a known issue. Unfortunately fixing this would break existing setups, so there is not much we can do. This is fixed in rhel7.


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