centos系統的設置ulimit的時候是直接修改/etc/security/limits.conf文件,但是在ubuntu中卻不行,
ubuntu先修改/etc/security/limits.conf文件
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535 root soft nproc 65535 root hard nproc 65535 root soft nofile 65535 root hard nofile 65535
注意L這個每個用戶都要配置,有些說只有root用戶才需要寫出來,但是有時候測試的時候發現普通用戶沒有寫在這沒有生效
test soft nproc 65535
test hard nproc 65535
test soft nofile 65535
test hard nofile 65535
添加common-session
在/etc/pam.d/common-session文件中,添加下面一行內容
session required pam_limits.so
重啟系統就可以生效