Retrieve Last Log After Crash

本文讨论了Linux系统中两种类型的崩溃:内核恐慌/内存溢出和用户空间核心转储。对于内核恐慌,通常配置为重启系统。不幸的是,恐慌日志只能打印到控制台,并且如果没有任何额外设备记录控制台日志,在重启后会消失。大多数内核恐慌/内存溢出日志不会被写入系统日志,即使它们被写入,也没有办法在恐慌期间将它们同步到磁盘存储。对于用户空间核心转储,默认情况下会在/tmp目录下生成核心文件。管理员可以根据情况决定是否需要重启系统或进程。虽然可以使用脚本来记录更多关于核心转储的日志,但有时将一些信息保留在持久性内存中也很有用,例如被核心转储的过程的回溯。

In Linux, there are two kinds of crashes - kernel panic/oom and user space core dump. For kernel panic, the standard config is rebooting the system. Unfortunately, the panic log can only be printed to console and will disappear after reboot if there is no additional device to record the console log - most kernel panic/oom logs won’t be written to system log, and even they do, there is no way to sync them to disk storage during panic.

As for user-sapce core dump, core files will be generated to /tmp/pid.core(core pattern can be changed in /proc/sys/kernel/core_pattern) by default. It is up to the admin to decide if the system or process needs reboot after core dump. Although a script can be used to record more logs for the coredump, sometimes it’s still useful to retain some info in the persistent memory, like the backtrace of the coredumped process.

- See more at: http://www.bo-yang.net/2015/05/27/retrieve-last-log/#sthash.jiD8jrf5.dpuf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值