为什么*/etc/security/limits.conf中不包含root用户?

ken*_*nji 2 linux limit ulimit

我在linux机器上以root身份运行java程序.为了增加Max open files限制,我添加了以下几行/etc/security/limits.conf

*       soft    nofile  1000000
*       hard    nofile  1000000
Run Code Online (Sandbox Code Playgroud)

但是当我检查正在运行的程序时cat /proc/<pid>/limits,它仍然告诉我它Max open files65536.在我添加另外两行之前/etc/security/limits.conf,Max open files可以将其更改为1000000

root       soft    nofile  1000000
root       hard    nofile  1000000
Run Code Online (Sandbox Code Playgroud)

我可以看到它的评论limit.conf,它说

通配符*,用于默认条目

那么当我使用*作为默认条目时,它是否包含root用户?为什么?

ffe*_*ast 5

正确,它不包括root用户.看起来它已经完成了设计.从

man 5 limits.conf
Run Code Online (Sandbox Code Playgroud)

注意:组和通配符限制不适用于root用户.要为root用户设置限制,此字段必须包含文字用户名root.