Re: Cleaning up background processes

Liste des GroupesRevenir à cu shell 
Sujet : Re: Cleaning up background processes
De : naddy (at) *nospam* mips.inka.de (Christian Weisgerber)
Groupes : comp.unix.shell
Date : 12. May 2024, 00:08:16
Autres entêtes
Message-ID : <slrnv3vr2g.1gfp.naddy@lorvorc.mips.inka.de>
References : 1 2 3 4 5
User-Agent : slrn/1.0.3 (FreeBSD)
On 2024-05-11, Kenny McCormack <gazelle@shell.xmission.com> wrote:

I have to ask:  Why couldn't you trap "kill -1 0" INT?
>
       trap "kill -TERM 0" INT
>
I don't get it.  Is there any significant difference between hitting it with
TERM vs. HUP?

I find "Terminated" less confusing than "Hangup", that's all.
Of course it would be even better if I could keep the asynchronous
process from ignoring SIGINT in the first place... Oh, maybe I can!

Instead of

    foo &

I can run

    (trap - INT; exec foo) &

and indeed that seems to restore the default behavior, i.e., terminate
the process, for both FreeBSD sh and bash.  Anybody see any problem
with that approach?

I'd also be interested in historical insights how this "ignore SIGINT
for asynchronous processes" behavior came to be.

--
Christian "naddy" Weisgerber                          naddy@mips.inka.de

Date Sujet#  Auteur
5 May 24 * Cleaning up background processes17Christian Weisgerber
5 May 24 +- Re: Cleaning up background processes1Lawrence D'Oliveiro
5 May 24 +- Re: Cleaning up background processes1Christian Weisgerber
6 May 24 +- Re: Cleaning up background processes1vallor
6 May 24 `* Re: Cleaning up background processes13Kaz Kylheku
6 May 24  `* Re: Cleaning up background processes12Kenny McCormack
8 May 24   +* Re: Cleaning up background processes9vallor
9 May 24   i+* Re: Cleaning up background processes4Janis Papanagnou
10 May 24   ii`* Re: Cleaning up background processes3Geoff Clare
10 May 24   ii `* Re: Cleaning up background processes2Janis Papanagnou
19 May 24   ii  `- Re: Cleaning up background processes1Martijn Dekker
11 May 24   i`* Re: Cleaning up background processes4Christian Weisgerber
11 May 24   i `* Re: Cleaning up background processes3Kenny McCormack
12 May 24   i  `* Re: Cleaning up background processes2Christian Weisgerber
13 May 24   i   `- Re: Cleaning up background processes1Geoff Clare
11 May 24   `* Re: Cleaning up background processes2Christian Weisgerber
11 May 24    `- Re: Cleaning up background processes1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal