Article 5B71K How does bash handle SIGTERM?

How does bash handle SIGTERM?

by
berndbausch
from LinuxQuestions.org on (#5B71K)
According to the Bash Reference:

Quote:
When Bash is interactive, in the absence of any traps, it ignores SIGTERM
When I send SIGTERM to the current bash process, indeed it is ignored. However, when I send SIGTERM to another interactive bash process, that process is terminated. Even setting up a trap doesn't change this.

Is this a misunderstanding? A bug? Something else?

On Centos 8.1:
Code:$ bash --version
GNU bash, version 4.4.19(1)-release (x86_64-redhat-linux-gnu)
$ ps
PID TTY TIME CMD
8372 pts/14 00:00:00 ps
12404pts/14 00:00:00 bash
$ kill -TERM 12404
$ ps
PID TTY TIME CMD
8373 pts/14 00:00:00 ps
12404pts/14 00:00:00 bash
$ ps -ef | grep 8337
user13 8337 13532 0 18:51 pts/4 00:00:00 bash
$ kill -TERM 8337
$ ps -ef | grep 8337
$Same result with version 5.0.17(1) running on Ubuntu 20 on WSL.latest?d=yIl2AUoC8zA latest?i=Mdiez_MIyF4:CBcAwtpqcL4:F7zBnMy latest?i=Mdiez_MIyF4:CBcAwtpqcL4:V_sGLiP latest?d=qj6IDK7rITs latest?i=Mdiez_MIyF4:CBcAwtpqcL4:gIN9vFwMdiez_MIyF4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments