Ubuntu开启core dump

前端之家收集整理的这篇文章主要介绍了Ubuntu开启core dump前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Ubuntu的默认不开启core dump。如果需要临时开启,用下面的命令。

ulimit -c unlimited
echo 1 > /proc/sys/kernel/core_uses_pid

如果需要开机就默认开启core dump,需要修改/etc/rc.local文件,注意文件修改的位置,我在头部加的

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

ulimit -c unlimited
echo 1 > /proc/sys/kernel/core_uses_pid

if [ -x /bin/plymouth ]; then plymouth message --text='Installing VMware Tools. Please wait...'; else chvt 2 </dev/tty0 >/dev/tty0; fi
cd /opt/vmware-tools-installer
./run_upgrader.sh
mv /etc/rc.local.backup /etc/rc.local
mv /etc/issue.backup /etc/issue
mv /opt/vmware-tools-installer/S*gdm /etc/rc2.d/ 2>/dev/null || true
mv /opt/vmware-tools-installer/S*kdm /etc/rc2.d/ 2>/dev/null || true
mv /opt/vmware-tools-installer/S*kdm-kde4 /etc/rc2.d/ 2>/dev/null || true
mv /opt/vmware-tools-installer/*dm.conf /etc/init/ 2>/dev/null || true
rm -rf /opt/vmware-tools-installer
chvt 1 < /dev/tty0 > /dev/tty0
(/sbin/initctl start lightdm || /sbin/initctl start gdm || /etc/init.d/gdm restart || /etc/init.d/kdm restart || /etc/init.d/kdm-kde4 restart) 2>/dev/null
原文链接:https://www.f2er.com/ubuntu/351523.html

猜你在找的Ubuntu相关文章