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

全部博文(108)

文章存档

2011年(40)

2010年(22)

2009年(17)

2008年(29)

我的朋友

分类: 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 
阅读(318) | 评论(0) | 转发(0) |
0

上一篇:Redhat bridging

下一篇:RHEL6网络配置命令

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