linux /etc/sysctl.conf,Linux 7 中 /etc/sysctl.conf 的位置变化

在Linux 系统中,我们通常把一些配置写到/etc/sysctl.conf文件,但在Linux 7中,这个规则稍微发生了变化。 https://www.cndba.cn/dave/article/2966

[root@18c sysctl.d]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.5 (Maipo)

[root@18c sysctl.d]# uname -a

Linux 18c 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@18c sysctl.d]#

[root@18c ~]# cat /etc/sysctl.conf

# sysctl settings are defined through files in

# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.

#

# Vendors settings live in /usr/lib/sysctl.d/.

# To override a whole file, create a new file with the same in

# /etc/sysctl.d/ and put new settings there. To override

# only specific settings, add a file with a lexically later

# name in /etc/sysctl.d/ and put new settings there.

#

# For more information, see sysctl.conf(5) and sysctl.d(5).

注意这里的文件面规则发生了改变,前面加了一个数字:

https://www.cndba.cn/dave/article/2966https://www.cndba.cn/dave/article/2966

[root@18c sysctl.d]# pwd

/etc/sysctl.d

[root@18c sysctl.d]# ls

99-sysctl.conf

[root@18c sysctl.d]#

我们可以查看帮助,对这块的解释:https://www.cndba.cn/dave/article/2966

[root@18c sysctl.d]# man sysctl.d

SYSCTL.D(5) sysctl.d SYSCTL.D(5)

NAME

sysctl.d - Configure kernel parameters

你可能感兴趣的:(linux)