我在 linux 机器上以 root 身份运行一个 java 程序。为了增加Max open files
限制,我将以下行添加到 /etc/security/limits.conf
* soft nofile 1000000
* hard nofile 1000000
然而,当我通过 cat /proc/<pid>/limits
检查正在运行的程序时,它仍然告诉我 Max open files
是 65536。直到我在 /etc/security/limits.conf
中添加了另外两行, Max open files
可以更改为1000000
root soft nofile 1000000
root hard nofile 1000000
我可以看到来自 limits.conf
的评论, 它说
the wildcard *, for default entry.
所以当我使用 * 作为默认条目时,它不包括 root 用户吗?为什么?
最佳答案
正确,它不包括 root 用户。看起来这是设计使然。来自
man 5 limits.conf
NOTE: group and wildcard limits are not applied to the root user. To set a limit for the root user, this field must contain the literal username root.
关于linux - 为什么* in/etc/security/limits.conf 不包含root 用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38991351/