2015-04-02 37 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 

这意味着你可以配置一些程序来接受核心转储,并通知谁感兴趣。

相关问题