Can not automatically apply sysctl.conf when boot up

General support questions
Post Reply
Halry
Posts: 2
Joined: 2015/01/21 13:12:42

Can not automatically apply sysctl.conf when boot up

Post by Halry » 2015/01/21 13:18:09

A VPS KVM machine.CentOS7 using linux kernel 3.18 from elrepo.I just found out the settings in /etc/sysctl.conf won't apply after reboot.Need to execute sysctl -p then it will apply.I am very curious why this happen?

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: Can not automatically apply sysctl.conf when boot up

Post by Super Jamie » 2015/01/21 22:38:12

Does the same thing happen with the standard kernel?

Does the same thing happen if you make a file like /etc/sysctl.d/mystuff.conf instead of /etc/sysctl.conf?

Do you have the systemd-sysctl.service enabled?

Halry
Posts: 2
Joined: 2015/01/21 13:12:42

Re: Can not automatically apply sysctl.conf when boot up

Post by Halry » 2015/01/22 00:02:05

Seems it is the priority problem.I write a script in init.d for executing "sysctl -p" then enabled it.It works.
I keep conf in sysctl.d folder.
systemd-sysctl.service show in systemctl is loaded,active,exited.
I don't know about whether it is a kernel problem.But in CentOS6,it works fine.
I found the same problem report in Ubuntu forum.Seems that is because sysctl worked before the partition mount.Sorry I am a newbie.

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: Can not automatically apply sysctl.conf when boot up

Post by Super Jamie » 2015/01/22 01:11:44

Sorry I didn't quite understand - did you try to make /etc/sysctl.d/mystuff.conf with your settings? Did this work?

Which sysctl settings are you trying to apply?

ashish.agrawal
Posts: 3
Joined: 2016/01/04 08:21:13

Re: Can not automatically apply sysctl.conf when boot up

Post by ashish.agrawal » 2016/01/04 08:31:04

same problem i am facing also. If i write net.ipv6.conf.all.disable_ipv6 = 1 in sysctl.conf. If i run sysctl -p. This is working fine and disabling ipv6 address. But after reboot ipv6 get enable again automatically.

ashish.agrawal
Posts: 3
Joined: 2016/01/04 08:21:13

Re: Can not automatically apply sysctl.conf when boot up

Post by ashish.agrawal » 2016/01/04 09:34:38

same problem i am facing.

if i configure net.ipv6.conf.all.disable_ipv6 = 1 in /etc/sysctl.conf

If i run the command sysctl -p its working fine. IPV6 get disable in the system.

But if i reboot the system ipv6 get re-enable in the system.

Same thing i have done in RHEL7. Its working fine.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Can not automatically apply sysctl.conf when boot up

Post by hunter86_bg » 2016/01/05 12:47:03

I have already tested this with vm.swappiness parameter.
In CentOs7.0 the issue is not pressent - and everything works fine, while in 7.2 (after updated and after clean install) it doesn't work. After

Code: Select all

sysctl -p /etc/sysctl.d/vm.swappiness.conf
or

Code: Select all

 systemctl restart systemd-sysctl 
everything is in working order. I have reported this as bug https://bugs.centos.org/view.php?id=10045.
Here is the ticket I have opened on the forum: viewtopic.php?f=47&t=55678

Please feel free to help the devs by giving them extra info , so they can find out solution faster.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Can not automatically apply sysctl.conf when boot up

Post by hunter86_bg » 2016/01/05 15:21:35

I have just received an aswer to the bug i have reported.
It seems that "tuned" daemon overwrites vm.swappiness settings in my case.
There are 2 solutions:
1. tune the "tuned" daemon or
2.disable the "tuned" daemon.

Post Reply

Return to “CentOS 7 - General Support”