I am working on a bash script that collects various diagnostic information on a CentOS server and packages them up so that they can be sent to our company for analysis. As part of this script, I check to see if the company's application is responsive. If it is not, I trigger a core dump of the application process:
kill -6 $app_pid
This command will cause a process core dump to be written for the pid $app_pid. However, I need a way to wait until the core dump generation is finished. Otherwise, I can create corrupt diagnostics packages due to the incomplete core dump.
I am hoping to do this check using the default centos packages but am also open to installing additional packages if I must.