If I start an ongoing background process A which starts a child process B, and I ask the OS to shut down, which processes get sent a SIGTERM? Is it both A and B or is it just A (assuming that A should be responsible for shutting down B)?
When a Linux (Ubuntu) system shuts down, which processes get sent a SIGTERM?
linux;ubuntu;shutdown;signals
The manual for shutdown says all:All processes are first notified that the system is going  down  by the signal SIGTERM.  This gives programs like vi(1) the time to save the file being edited, mail and news processing programs  a  chance  to exit  cleanly,  etc. There is no specified order; your programs should be prepared for either parent or child process to receive a SIGTERM first.  Normally there is a delay after receiving the signal (but it is not required).