|
From: Tait <gnu...@t4...> - 2012-01-10 10:31:45
|
> $ ./gnuplot # terminal defaults to qt > gnuplot> plot x # so far, so good > > [in another terminal window] > $ ps -efT | grep gnuplot # both ./gnuplot and gnuplot_qt visible > $ kill -9 <pid of ./gnuplot> > $ ps -efT | grep gnuplot # gnuplot_qt is visible, ./gnuplot is gone > ... > I think the problem is that if the parent process dies hard, > either from an unintentional segfault or from receiving a KILL signal, > then any atexit() processing that would have sent a signal to the > child doesn't happen. > ... The definition of a -9 kill is that the killed process CANNOT catch/handle/ignore the signal, receives no warning, and has no opportunity to clean up. Maybe you were thinking of a kill -1 (the default), which sends a sighup? A process would normally catch this and do the usual clean up before dying. The Qt discussion is way beyond my understanding, but the mechanism I've seen before for children to die gracefully when a parent dies is to keep a pipe open to the parent process, and then react to the sigpipe the child would receive if the parent died. |