2015-04-02 36 views
0

在Linux中,據我的理解,在父進程中,等待調用只有在子進程已經死亡時纔會返回。如果孩子決定轉儲核心,則等待只會在coredump發生後纔會返回。父進程是否可以知道孩子是否正在學習

在Linux中,父母是否有辦法知道孩子是否正在傾倒核心,如果是,則採取其他操作(某些Event發佈),並且一方面孩子可以繼續傾倒核心。也就是說,在開始轉儲核心之前,是否有方法讓子進程或內核通知父進程,它已經死亡並將立即轉儲核心?

由於

回答

1

人核心:

管道核心轉儲到一個程序

Since kernel 2.6.19, Linux supports an alternate syntax for the 
/proc/sys/kernel/core_pattern file. If the first character of this 
file is a pipe symbol (|), then the remainder of the line is 
interpreted as a program to be executed. Instead of being written to 
a disk file, the core dump is given as standard input to the program. 

實施例:

cat /proc/sys/kernel/core_pattern 
|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e 

這意味着你可以配置一些程序來接受核心轉儲,並通知誰感興趣。

相關問題