Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run exit tasks code with default bash flags and options (issues #700 and #1747) #1748

Conversation

jsmeix
Copy link
Member

@jsmeix jsmeix commented Mar 7, 2018

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.

@jsmeix jsmeix added the bug The code does not do what it is meant to do label Mar 7, 2018
@jsmeix jsmeix added this to the ReaR v2.4 milestone Mar 7, 2018
@jsmeix jsmeix self-assigned this Mar 7, 2018
@jsmeix jsmeix merged commit 4060f30 into rear:master Mar 7, 2018
@jsmeix jsmeix deleted the run_exit_tasks_code_with_default_bash_flags_and_options_issues_700_and_1747 branch March 7, 2018 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do fixed / solved / done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant