Why * in /etc/security/limits.conf doesn't include root user?

非 Y 不嫁゛ 提交于 2021-02-10 07:05:54

问题


I'm running a java program as root on a linux machine. In order to increase the Max open files limitation, I added the following lines into /etc/security/limits.conf

*       soft    nofile  1000000
*       hard    nofile  1000000

However when I check the running program by cat /proc/<pid>/limits, it still tells me that the Max open files is 65536. Until I added another two lines into /etc/security/limits.conf, the Max open files could be changed to 1000000

root       soft    nofile  1000000
root       hard    nofile  1000000

I can see the comments from limits.conf, it says that

the wildcard *, for default entry.

So when I use * as default entry, doesn't it include root user? Why?


回答1:


Correct, it doesn't include root user. Looks like it has been done by design. From

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.



来源:https://stackoverflow.com/questions/38991351/why-in-etc-security-limits-conf-doesnt-include-root-user

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!