我使用的是debian 7.4版本
那里的/etc/pam.d/su文件
不启用pam_limits.so
片段是:
# Sets up user limits, please uncomment and read /etc/security/limits.conf # to enable this functionality. # (Replaces the use of /etc/limits in old login) # session required pam_limits.so
这是为什么 ?
使用Googlesearch,获得类似的文章
https://my.vertica.com/docs/6.0.x/HTML/index.htm#14567.htm
On some systems the pam module called pam_limits.so is not set in the file /etc/pam.d/su. When it is not set, it prevents the conveying of limits (such as open file descriptors) to any command started with su - In particular, the HP Vertica init script would fail to start HP Vertica because it calls the Administration Tools to start a database with the su - command. This problem was first noticed on Debian systems, but the configuration could be missing on other Linux distributions. To resolve this issue, modify the install_vertica script and append this line to the /etc/pam.d/su file: session required pam_limits.so
默认(无限制)适用于大多数人。 对于大多数单用户,单用户和小型多用户系统,限制模块不是必需的,因为您不会碰到任何一个; 对于这个问题,遇到ulimit相关错误的小型系统用户可能不知道如何处理它。 另外,/ /etc/security/limits.conf没有预先configuration,因为没有办法知道你的需求是什么,所以你仍然需要调整configuration来设置限制。 不妨为大多数人节省一些(不足的)资源,让less数需要的人把这个function开启。