Re: Cleaning up background processes

Liste des GroupesRevenir à cu shell 
Sujet : Re: Cleaning up background processes
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell
Date : 10. May 2024, 13:57:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v1l5k7$1c28l$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 10.05.2024 14:35, Geoff Clare wrote:
Janis Papanagnou wrote:
 
But the pseudo-signal 'EXIT' is non-standard (to my knowledge), so you
cannot generally rely on it, depending on your environment, and the OP
asked for a "standard POSIX shell idiom".
 
Quoting POSIX.2-1992, 3.14.13:
 
    The condition can be EXIT; 0 (equivalent to EXIT); or a signal
    specified using a symbolic name, without the SIG prefix, as listed
    in Required Signals and Job Control Signals (Table 3-1 and Table 3-2
    in POSIX.1 {8}). (For example: HUP, INT, QUIT, TERM). Setting a
    trap for SIGKILL or SIGSTOP produces undefined results.
 
It has hardly changed in the current standard (POSIX.1-2017):
 
    The condition can be EXIT, 0 (equivalent to EXIT), or a signal
    specified using a symbolic name, without the SIG prefix, as listed
    in the tables of signal names in the <signal.h> header defined in
    XBD Chapter 13; for example, HUP, INT, QUIT, TERM. Implementations
    may permit names with the SIG prefix or ignore case in signal
    names as an extension. Setting a trap for SIGKILL or SIGSTOP
    produces undefined results.
 

That's good. (And I was obviously misremembering.) Thanks!

BTW, I'm astonished about the "undefined results" for KILL/STOP. Yes,
on OS-level they cannot be caught but why undefined behavior on shell
level; what is the reason or practical rationale for that?

Janis


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