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
重启系统就可以生效
来源: http://www.bubuko.com/infodetail-3337591.html