How does the deadlock process behave when it is accepted by init?

imagine the following situation: the existing process Agraine fork generates child process B, and child process B calls exit (0), then B sends a SIGCHLD signal to parent process A, and parent process A chooses to ignore this signal, and process B becomes a dead process.

so what happens if An ends normally at this point, and B should be handed over to become a child of the init process? Will B resend the SIGCHLD signal to init? If not, how will B end in the end?

Jun.11,2021

B will not send any more signals, and this zombie process will eventually be automatically recycled by the init process (pid=1).

Please refer to

When a process loses its parent, init becomes its new parent. Init periodically executes the wait system call to reap any zombies with init as parent.

https://en.wikipedia.org/wiki.

Menu