开启系统的coredump文件设置

来源:互联网 发布:win10 休眠不关闭网络 编辑:程序博客网 时间:2024/06/16 06:54
#!/bin/bash
echo -e "/home/corefile/core-%e-%s-%u-%g-%p-%t" > /proc/sys/kernel/core_pattern
echo -e "1" > /proc/sys/kernel/core_uses_pid


grep "* hard core unlimited" /etc/security/limits.conf > /dev/null 
if [ $? -ne 0 ]; then
echo "* hard core unlimited" >> /etc/security/limits.conf
fi


ulimit -S -c unlimited


if [ ! -d "/home/corefile" ]; then
cd /home && mkdir corefile && chmod 777 corefile
fi
0 0
原创粉丝点击