yae*_*ael 4 linux rhel kernel sysctl
当我们sysctl -p
在我们的 rhel 7.2 上运行时,server1
我们得到
sysctl -p
fs.file-max = 500000
vm.swappiness = 10
vm.vfs_cache_pressure = 50
sysctl: cannot stat /proc/sys/pcie_aspm: No such file or directory
net.core.somaxconn = 1024
# ls /proc/sys/pcie_aspm
ls: cannot access /proc/sys/pcie_aspm: No such file or directory
Run Code Online (Sandbox Code Playgroud)
但是,当我们运行sysctl -p
其他的server2
如
我们得到了没有错误的好结果
sysctl -p
fs.file-max = 500000
vm.swappiness = 10
vm.vfs_cache_pressure = 50
net.core.somaxconn = 1024
Run Code Online (Sandbox Code Playgroud)
该文件 -/proc/sys/pcie_aspm
此服务器上也不存在 ( server2
)
那么为什么sysctl -p
失败server1
呢?
正如评论中透露的那样,有一个
pcie_aspm=off
Run Code Online (Sandbox Code Playgroud)
行在sysctl -p
读取的文件之一中。这会导致sysctl
尝试写入/proc/sys/pcie_aspm
;如果它不存在(它不会,它不是一个有效的sysctl
条目,它是一个内核引导参数),你会得到你的问题中显示的错误。