When will the child process die when parent process is killed?

linux

314 观看

1回复

1507 作者的声誉

In a program A, it calls a script B. And in the script B, it calls wpa_supplicant directly (not via this way: systemctl start wpa_supplicant) to config WIFI network. And we found that if the program A is killed, sometimes the network will be disconnected while sometimes the network keeps connected.

program A -> call script B -> call wpa_supplicant

So I want to know why? In my understanding, if the parent process is killed, then the child process will die automatically, right? Why sometimes the network keeps connected? Which means the child process wpa_supplicant is still alive, right?

作者: Tom Xue 的来源 发布者: 2017 年 12 月 27 日

回应 1


1

115296 作者的声誉

When the parent process terminates before the child process, the child process remains as a so called orphan process on the system until it terminates. After it terminates, it will become a zombie until it gets reaped by init.

作者: hek2mgl 发布者: 2017 年 12 月 27 日
32x32