How I can determine that core.<pid> file generation started/finished?
Is there a hook to determine core file generation finished
linux;core dump
You can put an inotify watch in the directory that will contain the core file. Demonstration:/tmp$ { ulimit -c unlimited; exec sleep 9999; } &[1] 25646/tmp$ kill -QUIT %1                              [1]  + 25646 quit (core dumped)  { ulimit -c unlimited; exec sleep 9999; }And in another terminal:$ inotifywait -e close_write /tmpSetting up watches.Watches established./tmp/ CLOSE_WRITE,CLOSE coreThat last line, reporting a CLOSE_WRITE event, is emitted when the core file is fully written.Alternatively, Linux lets you customize the generation of core files. This is a system-wide setting and requires root access, so it may or may not suit your scenario. You do this by setting the kernel.core_pattern ioctl to point to a program that will receive the core content on standard output. A toy program could be#!/bin/shcat >/var/cores/$1-$2-$3.core# Do whatever you want now that the core file has been writtenecho /var/cores/$1-$2-$3.core | mail -s $4 dumped core denysin /usr/local/sbin/my_core_dumper, registered withsysctl kernel.core_pattern='|/usr/local/sbin/my_core_dumper %t %P %e %E'