设置coredump大小为‘无限’
ulimit -c unlimited
开启coredump记录进程号
echo "1" > /proc/sys/kernel/core_uses_pid
指定coredump路径
echo "/home/panchen/core-%e-%p-%t"> /proc/sys/kernel/core_pattern
压缩coredump
cat /usr/local/sbin/core_helper
#! bin/sh
exec gzip - > /home/panchen/$1-$2-$3-$4.core.gz
echo "|/usr/local/sbin/core_helper" > /proc/sys/kernel/core_pattern
时间: 2024-10-11 13:40:36