From 4c38a4a985833aa50afb7f63746dab6d1f28d666 Mon Sep 17 00:00:00 2001 From: Michael Weiser Date: Thu, 28 Feb 2019 13:37:39 +0000 Subject: Do not trap SIGCHLD for dash compatibility dash honors our trapping of SIGCHLD and will cause the script to exit after the first external command finishes executing. Strangely enough, bash seems to ignore the same attempt to catch SIGCHLD. --- src/usr/share/laps/laps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/usr/share/laps/laps.sh b/src/usr/share/laps/laps.sh index 1209f65..9780b9e 100755 --- a/src/usr/share/laps/laps.sh +++ b/src/usr/share/laps/laps.sh @@ -679,7 +679,9 @@ define_if_new LAPS_INTERACTIVE 0 # SET TRAPS #trap "CTRLC" 2 #trap "CTRLZ" 18 -trap '__ec=$? ; clean_laps ; trap "" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; exit ${__ec} ;' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +# do NOT catch SIGCHLD (17) because dash will actually exit then (bash seems to +# ignore our attempt to catch it) +trap '__ec=$? ; clean_laps ; trap "" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 ; exit ${__ec} ;' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 # DEBUG SIMPLECONF debuglev 5 && { -- cgit