在 CentOS Linux 7.1.1503 版(Linux 内核版本 3.10.x)VM 上,我将以下几行添加到 /etc/security/limits.conf 和 /etc/security/limits.d/20-nproc.conf:
someuser soft nofile 8000
someuser hard nofile 8000
Run Code Online (Sandbox Code Playgroud)
重启虚拟机后,ulimit -n依然报4096,ulimit -n 8000依然是“-bash:ulimit:open files:cannot modify limit:Operation not allowed”。
我很难过此时如何增加打开文件的限制。