#1748 PR merged
: Run exit tasks code with default bash flags and options (issues #700 and #1747)¶
Labels: bug
, fixed / solved / done
jsmeix opened issue at 2018-03-07 10:26:¶
-
Type: Bug Fix
-
Impact: Normal
-
Reference to related issue (URL):
https://github.com/rear/rear/issues/1747#issuecomment-371055121
https://github.com/rear/rear/issues/700#issuecomment-327755633 -
How was this pull request tested?
In usr/share/rear/layout/prepare/default/420_autoresize_last_partitions.sh
use an unbound variable for testing e.g. as follows
set -e -u -o pipefail echo "$DOESNOTEXIST"
which lets that script abort.
Without the fix it looks during "rear recover"
RESCUE d57:~ # rear -D recover ... Confirm or edit the disk mapping 1) Confirm disk mapping and continue 'rear recover' 2) Edit disk mapping (/var/lib/rear/layout/disk_mappings) 3) Use Relax-and-Recover shell and return back to here 4) Abort 'rear recover' (default '1' timeout 300 seconds) UserInput: No real user input (empty or only spaces) - using default input UserInput: Valid choice number result 'Confirm disk mapping and continue 'rear recover'' User confirmed disk mapping Exiting rear recover (PID 851) and its descendant processes RESCUE d57:~ #
With the fix it looks during "rear recover"
RESCUE d57:~ # rear -D recover ... Confirm or edit the disk mapping 1) Confirm disk mapping and continue 'rear recover' 2) Edit disk mapping (/var/lib/rear/layout/disk_mappings) 3) Use Relax-and-Recover shell and return back to here 4) Abort 'rear recover' (default '1' timeout 300 seconds) UserInput: No real user input (empty or only spaces) - using default input UserInput: Valid choice number result 'Confirm disk mapping and continue 'rear recover'' User confirmed disk mapping Exiting rear recover (PID 871) and its descendant processes Running exit tasks rear recover failed, check /var/log/rear/rear-d57.log for details RESCUE d57:~ #
- Brief description of the changes in this pull request:
In the DoExitTasks() function first of all restore the ReaR default bash flags and options
because otherwise in case of a bash error exit when e.g. "set -e -u -o pipefail" was set
all the exit tasks related code would also run with "set -e -u -o pipefail" still set
which may abort exit tasks related code anywhere with a "sudden death" bash error exit
where in particular no longer the EXIT_FAIL_MESSAGE would be shown
so that for the user ReaR would "just somehow silently abort" in this case.
[Export of Github issue for rear/rear.]