Disable core dump

概述

有时候测试环境比较弱,资源开销比较大,一旦产生core dump file,期间会消耗CPU、memory和disk空间。为了暂时规避此问题,需要禁止产生core dump。

操作步骤

To disable core dumps for all users

open /etc/security/limits.conf, enter:

shell

# vi /etc/security/limits.conf

Make sure the following config directive exists

shell

* soft core 0
* hard core 0

Save and close the file

Once a hard limit is set in /etc/security/limits.conf, the user cannot increase that limit within his own session. Add fs.suid_dumpable = 0 to /etc/sysctl.conf file:

shell

# echo 'fs.suid_dumpable = 0' >> /etc/sysctl.conf
# sysctl -p

This will make sure that core dumps can never be made by setuid programs.

Set soft limit

Finally, add the following to /etc/profile to set a soft limit to stop the creation of core dump files for all users (which is default and must be disabled):

shell

# echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile


来源: Transcendent
文章作者: Gavin Wang
文章链接: Disable core dump | Transcendent
本文章著作权归作者所有,任何形式的转载都请注明出处。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值