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

1785

被折叠的 条评论
为什么被折叠?



