有的只要做了第一步就够了。有的第三就够了。需不同系统不同版本测试。
第一步:
sudo vim /etc/security/limits.conf 文件尾追加
* hard nofile 65535
* soft nofile 65535
* soft core unlimited
第二步:
sudo vim /etc/pam.d/su将 pam_limits.so 这一行注释去掉 重起系统
或者 sudo vim /etc/pam.d/common-session加上以下一行session required pam_limits.so
第三步:
配置/etc/profile最后一行加上ulimit -SHn 65535 其实等效 ulimit -n 65535,-S指soft,-H指hard

core文件开关
sed -i '$a ulimit -SHn 65535' /etc/profile
sed -i '$a ulimit -SHc unlimited' /etc/profile
sed -i '$a kernel.core_pattern = %e_%p.core' /etc/sysctl.conf
sed -i 's/enabled=1/enabled=0/' /etc/default/apport

分开写的方式:
sed -i '$a ulimit -H -c unlimited' /etc/profile
sed -i '$a ulimit -S -c unlimited' /etc/profile

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-11-22
  • 2021-07-25
  • 2021-12-31
猜你喜欢
  • 2021-07-13
  • 2021-05-27
  • 2022-12-23
  • 2021-09-28
  • 2021-10-07
  • 2022-02-26
相关资源
相似解决方案