RE: EXT: Re: EXIT trap does not fire

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

 



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             




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

  Powered by Linux