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

前端 未结 5 1202
情书的邮戳
情书的邮戳 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:03

    On UNIX, there is no enforced relation between parent and child process's lifetimes. Strictly speaking, process will only terminate when they call exit() or receive an unhandled signal for which default action is to terminate.

    However, an entire "foreground process group" in a "controlling terminal" can receive signals like SIGINT and SIGQUIT when the user hits ctrl-C, ctrl-\, etc. on that terminal. Specific behaviour is partly implemented by the login shell (with help from the tty driver). Details may be quite complicated: look here and here

提交回复
热议问题