This is for learning only on CentOS7.
Code:
I have edited config file for
1) cat /etc/sysctl.d/01-swappiness.conf #I named this file.
vm.swappiness = 31
2) cat /etc/sysctl.conf #default config
vm.swappiness = 35
#At reboot time, I have this resuly.
#Original kernel parameter value is vm.swappiness=30
# sysctl vm.swappiness
vm.swappiness = 30
#Notice above, the vm.swappiness is not from
/etc/sysctl.d/01-swappiness.conf
or
/etc/sysctl.conf
#But at runtime, I am able to load the sysctl config file:
# sysctl -p /etc/sysctl.d/01-swappiness.conf
vm.swappiness = 31
#Check result
# sysctl vm.swappiness
vm.swappiness = 31
#I am able to load the default sysctl config file:
# sysctl -p /etc/sysctl.conf
vm.swappiness = 35
#Check result
# sysctl vm.swappiness
vm.swappiness = 35
So what is overriding the custom settings in
/etc/sysctl.conf and /etc/sysctl.d/01-swappiness.conf ?