Linux下设置coredump脚本
程序员文章站
2022-06-03 21:39:10
...
linux下调试程序崩溃一般都有coredump生成,可以设置coredump生成路径
#!/bin/sh
sed -i '/# End of file/i\* soft core unlimited' /etc/security/limits.conf
sed -i '/# End of file/i\* hard core unlimited' /etc/security/limits.conf
sed -i '/# End of file/i\* soft nofile 65535' /etc/security/limits.conf
sed -i '/# End of file/i\* hard nofile 65535' /etc/security/limits.conf
echo "kernel.core_pattern=/home/coredump/%e.core.%p.%t" >> /etc/sysctl.conf
echo "fs.suid_dumpable = 1" >> /etc/sysctl.conf
rm -rf /home/coredump
mkdir /home/coredump
echo "DAEMON_COREFILE_LIMIT='unlimited’" >> /etc/sysconfig/init
echo "coredump文件存放在/home/coredump路径下"
sleep 7
reboot
上一篇: linux环境变量设置
下一篇: php配置文件php.ini修改无效