linux – ulimit -n not changing – values limits.conf无效
我正在尝试为ubuntu计算机上的所有用户提高打开文件描述符的最大值.
这个问题在某种程度上是对这个问题的跟进. open file descriptor limits.conf setting isn’t read by ulimit even when pam_limits.so is required 除了我在limits.conf中添加了所需的“root”条目 这是条目 * soft nofile 100000 * hard nofile 100000 root soft nofile 100000 root hard nofile 100000 与pam_limits.so相关的行已在/etc/pam.d/中的所有相关文件中取消注释,并且fs.file-max已在/etc/sysctl.conf中正确设置 但是,我仍然看到 abc@machine-2:/etc/pam.d$ulimit -n 1024 重启后. 可能是什么问题呢? 我的默认shell是/ bin / sh,我不能使用chsh来更改我的默认shell,因为我的机器上的用户通过一些分布式身份验证方案进行了身份验证. 解决方法
在以root身份登录的Redhat服务器上
在/etc/security/limits.conf user01 - nofile 2048 strace命令以root身份登录 strace -o loglimit su - user01 与其他shell打开loglimit grep "limit" loglimit open("/lib64/security/pam_limits.so",O_RDONLY) = 6 .......... .......... open("/etc/security/limits.conf",O_RDONLY) = 3 read(3,"# /etc/security/limits.confn#n#E"...,4096) = 1823 open("/etc/security/limits.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 3 setrlimit(RLIMIT_NOFILE,{rlim_cur=2*1024,rlim_max=2*1024}) = 0 我这样知道,pam_limits被加载并且limits.conf被加载了,如果你的pam_limits被加载但是你仍然看到使用ulimit -n的其他值,请检查你的shell配置文件为@etherfish告诉 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |