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
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值