我有以下几行 /etc/security/limits.conf
* soft nofile 32768
* hard nofile 65536
root soft nofile 32768
root hard nofile 65536
Run Code Online (Sandbox Code Playgroud)
该pam_limits.so
文件必须在以下各文件。
/etc/pam.d/common-session
/etc/pam.d/cron
/etc/pam.d/login
/etc/pam.d/sshd
/etc/pam.d/su
/etc/pam.d/sudo
Run Code Online (Sandbox Code Playgroud)
ulimit -n
登录时(以及启动时启动的服务)仍然显示 1024。
我错过了什么?
你检查过你没有其他配置文件吗/etc/security/limits.d/
?
您是否尝试过增加它ulimit
?
$ ulimit -n 4096
$ ulimit -n
4096
Run Code Online (Sandbox Code Playgroud)
并且保存后必须重新登录。仅仅启动一个 shell 是不够的,它必须是一个登录 shell。