kill - does it kill the process right away?
I found my answer and I set up a signal handler for SIGCHLD
and introduced wait
in that handler. That way, whenever parent process kill
s a child process, this handler is called and it calls wait
to reap the child. - motive is to clear process table entry.
I am still seeing some child processes going for a few seconds even without its parent process dying. - how is this possible?
I am seeing this via ps
. Precisely ps -o user,pid,ppid,command -ax
and greping for parent process, child process and defunct.