可以在/etc/sysctl.conf里設(shè)置。
%e: 可執(zhí)行文件名
%p: 進(jìn)程的PID
%u: real uid of the process
%g: real gid of the process
%t: the time when the core is dumped
%h: host name
%c: the max size of the core dump file
在上面的設(shè)置下,如果一個(gè)名為 test的程序產(chǎn)生了core dump, 則他的名字為 test.core.123 (這里假設(shè)其pid為 123)
如果在 sysctl.conf里改變了設(shè)置,之后要執(zhí)行 sysctl -p 使之生效。
設(shè)置生成壓縮的 core文件
首先,創(chuàng)建文件 core_helper:
修改 sysctl.conf文件內(nèi)容:
#cat etc/sysctl.conf
kernel.core_pattern = |/usr/sbin/core_helper %e %p
kernel.core_uses_pid = 0
#cat /proc/sys/kernel/core_pattern
|/usr/sbin/core_helper %e %p
重新執(zhí)行 sysctl -p 之后,就會(huì)生成 test.core.1234.gz 這樣的文件。
man core 里有對(duì)于這個(gè)管道符號(hào)的解釋?zhuān)?/p>
-
Linux
+關(guān)注
關(guān)注
87文章
11469瀏覽量
212931 -
文件
+關(guān)注
關(guān)注
1文章
578瀏覽量
25235 -
虛擬機(jī)
+關(guān)注
關(guān)注
1文章
963瀏覽量
29132
發(fā)布評(píng)論請(qǐng)先 登錄
如何共享文件給虛擬機(jī)中的Linux系統(tǒng)

使用VMware給虛擬機(jī)安裝linux系統(tǒng)
段錯(cuò)誤調(diào)試神器 - Core Dump詳解
linux虛擬機(jī)怎么聯(lián)網(wǎng)
虛擬機(jī):QEMU虛擬機(jī)和主機(jī)無(wú)線網(wǎng)絡(luò)通訊設(shè)置

VMware虛擬機(jī)和主機(jī)傳輸文件

linux虛擬機(jī)使用教程
虛擬機(jī)linux怎么編寫(xiě)程序
怎么安裝linux虛擬機(jī)
虛擬機(jī)數(shù)據(jù)恢復(fù)—EXT4文件系統(tǒng)下KVM虛擬機(jī)數(shù)據(jù)恢復(fù)案例

服務(wù)器數(shù)據(jù)恢復(fù)—KVM虛擬機(jī)raw格式磁盤(pán)文件數(shù)據(jù)恢復(fù)案例

虛擬機(jī)數(shù)據(jù)恢復(fù)—KVM虛擬機(jī)被誤刪除的數(shù)據(jù)恢復(fù)案例

評(píng)論