When a parent process is killed by “kill -9”, will subprocess also be killed?

前端 未结 5 1196
情书的邮戳
情书的邮戳 2021-02-01 05:38

One of my colleague told me this morning, when he killed supervisord by \"kill -9\", the subprocesses of supervisord is not killed.

He is quite sure about that, but I

5条回答
  •  醉梦人生
    2021-02-01 06:15

    No, child processes are not necessarily killed when the parent is killed.

    However, if the child has a pipe open which it is writing to and the parent is reading from, it will get a SIGPIPE when it next tries to write to the pipe, for which the default action is to kill it. That is often what happens in practice.

提交回复
热议问题