Application monitoring for kernel dumps

I am planning to create a C / C ++ application that runs like a daemon and collects core dumps when and when they happen along with the application log files. Is there any way in Linux where I can tell the application crashed.

+3


source to share


2 answers


First, you can change the directory that the core dump file writes. On linux this is /proc/sys/kernel/core_pattern

(see this blog )

Second, you can control the change directory, see Inotify - how to use it? - linux .



Just install the main template to a specific directory and track it for new files.

+4


source


Another option (among other good suggestions) might be to set / proc / sys / kernel / core _pattern to connect the main file to the application as it is built, as described here . An application can, for example, decide whether to create the main file or not, where to store the main file, compress the main file on the fly, or notify another application via IPC that the main file has been created.



+1


source







All Articles