Use core_pattern for configuration and management of core files

Reference: https://xz.aliyun.com/t/1098

Core_pattern mentioned here refers to: / proc / sys / kernel / core_pattern. We know that in the Linux system, if the process crashes, the kernel will crash information capture process, then the process will write coredump information to a file, the default file name is core, but can also modify the configuration file by name. For example, can be specified by modifying the contents of / proc / sys / kernel / core_pattern file.

Manual describes the Linux man of about core_pattern: http://man7.org/linux/man-pages/man5/core.5.html

img

Since Linux kernel 2.6.19 core_pattern only after a specified packet may contain information coredump file name, you can also add a pipeline for Linux user space or a script:

img

If the first character is core_pattern Linux pipe symbol |, then the Linux kernel crash information at the time of the capture process, it will break the back door to execute pipeline root privileges program or script that will process crashes pass information to this program or script.

core files are passed to the script core_pattern configured as a standard input in the script can redirect input to the directory they need, and can be compressed in the redirect process. In addition, it is possible to clean up the existing core file before writing to the file redirection.

Guess you like

Origin www.cnblogs.com/jmliao/p/11718101.html