Chinaunix首页 | 论坛 | 博客
  • 博客访问: 336661
  • 博文数量: 135
  • 博客积分: 4637
  • 博客等级: 上校
  • 技术积分: 1410
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 13:22
文章分类

全部博文(135)

文章存档

2013年(12)

2012年(14)

2011年(42)

2010年(22)

2009年(18)

2008年(27)

分类: LINUX

2011-03-11 17:10:09

Enable coredumps in daemon start script

In the daemon startup script (/etc/init.d/mydaemon) add the following line before the definition of the "start()" method:

DAEMON_COREFILE_LIMIT="unlimited"

Enable coredumps globally

Edit the /etc/profile configuration file. Search for existing ulimit -c commands and replace with:

# Enable core files by default
ulimit -c unlimited > /dev/null 2>&1

Allow setuid programs to dump core

# The suid_dumpable control file is found in different places ...
if [ -e /proc/sys/kernel/suid_dumpable ]; then
  echo 1 > /proc/sys/kernel/suid_dumpable
else
  echo 1 > /proc/sys/fs/suid_dumpable
fi

Changing coredump location

echo /var/tmp/core > /proc/sys/kernel/core_pattern

Make above changes persistent after reboot

Add the following entries to /etc/sysctl.conf:

# Allow suid programs to dump core
fs.suid_dumpable = 1

# Dump core in /var/tmp
kernel.core_pattern = /var/tmp/core

Testing coredumps

Send the process the SIGABRT signal, it should abort and dump core:

kill -ABRT 
阅读(547) | 评论(0) | 转发(0) |
0

上一篇:Redhat bridging

下一篇:RHEL6网络配置命令

给主人留下些什么吧!~~