Dash Archive mirror
 help / color / mirror / Atom feed
From: "Fisher, Charles J. (Top Echelon)" <Charles.Fisher@arconic.com>
To: Akbarkhon Variskhanov <akbarkhon.variskhanov@gmail.com>,
	"dash@vger.kernel.org" <dash@vger.kernel.org>
Subject: RE: EXT: Re: EXIT trap does not fire
Date: Mon, 14 Nov 2022 16:41:18 +0000	[thread overview]
Message-ID: <CH2PR11MB4230294BB3964937E921C51781059@CH2PR11MB4230.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CANeoM1GQ6XsittRZAE-hZLQYngjF_B5Rm7f786cB3vLQY6dLmw@mail.gmail.com>

Is this the optimal trap to catch most terminations in dash?

trap "cleanup" ABRT EXIT FPE HUP INT KILL QUIT SEGV TERM

Adding CHLD causes one of my scripts to go berserk. I will commonly use FPE to kill when I'm trying to avoid signal handlers, yet not use -9 (this may be a bad habit).


CentOS 7 signals:

$ kill -l
 1    HUP Hangup                        33     33 Signal 33               
 2    INT Interrupt                     34     34 Signal 34               
 3   QUIT Quit                          35     35 Signal 35               
 4    ILL Illegal instruction           36     36 Signal 36               
 5   TRAP Trace/breakpoint trap         37     37 Signal 37               
 6   ABRT Aborted                       38     38 Signal 38               
 7    BUS Bus error                     39     39 Signal 39               
 8    FPE Floating point exception      40     40 Signal 40               
 9   KILL Killed                        41     41 Signal 41               
10   USR1 User defined signal 1         42     42 Signal 42               
11   SEGV Segmentation fault            43     43 Signal 43               
12   USR2 User defined signal 2         44     44 Signal 44               
13   PIPE Broken pipe                   45     45 Signal 45               
14   ALRM Alarm clock                   46     46 Signal 46               
15   TERM Terminated                    47     47 Signal 47               
16 STKFLT Stack fault                   48     48 Signal 48               
17   CHLD Child exited                  49     49 Signal 49               
18   CONT Continued                     50     50 Signal 50               
19   STOP Stopped (signal)              51     51 Signal 51               
20   TSTP Stopped                       52     52 Signal 52               
21   TTIN Stopped (tty input)           53     53 Signal 53               
22   TTOU Stopped (tty output)          54     54 Signal 54               
23    URG Urgent I/O condition          55     55 Signal 55               
24   XCPU CPU time limit exceeded       56     56 Signal 56               
25   XFSZ File size limit exceeded      57     57 Signal 57               
26 VTALRM Virtual timer expired         58     58 Signal 58               
27   PROF Profiling timer expired       59     59 Signal 59               
28  WINCH Window changed                60     60 Signal 60               
29     IO I/O possible                  61     61 Signal 61               
30    PWR Power failure                 62     62 Signal 62               
31    SYS Bad system call               63     63 Signal 63               
32     32 Signal 32                     64     64 Signal 64             

      parent reply	other threads:[~2022-11-14 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 11:02 EXIT trap does not fire Akbarkhon Variskhanov
2022-11-12 12:02 ` Harald van Dijk
2022-11-14 16:41 ` Fisher, Charles J. (Top Echelon) [this message]

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=CH2PR11MB4230294BB3964937E921C51781059@CH2PR11MB4230.namprd11.prod.outlook.com \
    --to=charles.fisher@arconic.com \
    --cc=akbarkhon.variskhanov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).