Re: [RFC PATCH] Allow trap to override permanently-ignored signals in background shells

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 08/03/2024 11:01, Johannes Altmanninger wrote:
TL;DR: I think this job should exit on Control-C.

	( trap - INT; sleep inf ) &

The TL;DR is oversimplified: Control-C would not result in SIGINT being sent to the sleep command, because it runs in the background.

Your fuller version, I agree, I think that is a bug in dash. There are some more known bugs in its handling of the trap command in subshells that require a bigger rework (particularly the one where, despite traps being reset in subshells, the 'trap' command should print the parent shell's traps if called in a subshell) that maybe should be looked at at the same time.

In general, I wonder if SIGINT is only for actual shells, and SIGTERM
is the signal to use in our situation.

SIGINT is not limited to shells. At first glance, sending SIGINT to another process or process group upon receipt of SIGINT, because that other process or process group is what it was intended for, seems like an appropriate use to me.

Cheers,
Harald van Dijk




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux