coredump位置修改

To change the location of the newly created core files, you have to change the content of /proc/sys/kernel/core_pattern:

Code:
sudo echo /tmp/core > /proc/sys/kernel/core_pattern

this will put the core dumps in /tmp, naming them "core". You can also add some modifiers to the content of the above, to customize the name of the core file, for example:

Code:
sudo echo /tmp/core.%u.%p > /proc/sys/kernel/core_pattern

will add the user ID of the owner of the process and the PID of the process itself. Other modifiers are available. See man 5 core for details.

Ah, just forgotten... by modifying a value under /proc you will lost changes upon reboot. To make them permanent, you can edit the file /etc/sysctl.conf, for example by adding the following lines

Code:
# Setup a directory to save core files into
kernel.core_pattern = /tmp/core
I've had a few core dumps since I made these changes, and they don't seem to be effecting the placement of core files.

I have " kernel.core_pattern = /tmp/core" in /etc/ sysctl.conf, /proc/sys/kernel/core_pattern is: "|/usr/share/apport/apport "

I would really like to get these buggers in /tmp, as they are quite large.
Strange. If you did not reboot the machine after the modification of /etc/ sysctl.conf, the change has not been applied. Have you manually modified the content of /proc/sys/kernel/core_pattern using the echo command?
Code:
sudo echo /tmp/core > /proc/sys/kernel/core_pattern
yes this command does the trick (well, I have to su in, it doesn't work with sudo because of the > redirection thing), but as you said, it does not stick after a reboot.

" kernel.core_pattern = /tmp/core" doesn't seem to change this.
 

转载于:https://www.cnblogs.com/SophiaTang/archive/2013/04/14/3020145.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值