Why can’t I kill a SIGSTOP’d process with a SIGTERM, and where is the pending signal stored?

SIGTERM is just like any other signal in that it can be caught by a process. Receiving the signal will just make the process jump to a special signal handler routine. For SIGTERM the default action will be to terminate the process, but e.g. an editor might like to catch the signal so it can save a draft copy of any open files before dying. If the process is stopped, it cannot run the signal handler, but the signal will remain pending until the process continues. Note that the number of signals sent will usually not be saved.

In theory, the system could know if the process has a signal handler installed for SIGTERM, and terminate it immediately if not. But (as per Gilles’ comment) POSIX demands that the signal will pend until the process is continued via SIGCONT.

You may Also Like:

None found

Leave a Comment