All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Johannes Altmanninger <aclopte@gmail.com>, dash@vger.kernel.org
Subject: Re: [RFC PATCH] Allow trap to override permanently-ignored signals in background shells
Date: Fri, 8 Mar 2024 11:48:11 +0000	[thread overview]
Message-ID: <b42dbf13-989d-4609-bbcb-8b9eababbe65@gigawatt.nl> (raw)
In-Reply-To: <20240308110158.2459219-1-aclopte@gmail.com>

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

  reply	other threads:[~2024-03-08 11:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 11:01 [RFC PATCH] Allow trap to override permanently-ignored signals in background shells Johannes Altmanninger
2024-03-08 11:48 ` Harald van Dijk [this message]
2024-03-29 11:24   ` [PATCH v2] Allow trap to un-ignore SIGINT in asynchronous subshells Johannes Altmanninger
2024-03-29 13:50     ` Jilles Tjoelker
2024-03-29 15:02       ` Johannes Altmanninger
2024-03-29 15:39         ` [PATCH v3] Allow trap to un-ignore SIGINT/SIGQUIT in async subshells Johannes Altmanninger
2024-04-07 11:18           ` Herbert Xu
2024-05-18  8:38             ` [PATCH v4] " Johannes Altmanninger
2024-05-18  8:43             ` [PATCH v3] " Johannes Altmanninger
2024-05-18  9:02               ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b42dbf13-989d-4609-bbcb-8b9eababbe65@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=aclopte@gmail.com \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.