Bug 2035872
Summary: | Evaluation enhancement of PRE_RECOVERY/POST_RECOVERY/PRE_BACKUP/POST_BACKUP scripts | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Renaud Métrich <rmetrich> | |
Component: | rear | Assignee: | Pavel Cahyna <pcahyna> | |
Status: | CLOSED ERRATA | QA Contact: | David Jež <djez> | |
Severity: | medium | Docs Contact: | Šárka Jana <sjanderk> | |
Priority: | medium | |||
Version: | 8.5 | CC: | djez, ovasik, pcahyna | |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged | |
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | rear-2.6-5.el8 | Doc Type: | Enhancement | |
Doc Text: |
.ReaR adds new variables for executing commands before and after recovery
With this enhancement, ReaR introduces two new variables for easier automation of commands to be executed before and after recovery:
* `PRE_RECOVERY_COMMANDS` accepts an array of commands. These commands will be executed before recovery starts.
* `POST_RECOVERY_COMMANDS` accepts an array of commands. These commands will be executed after recovery finishes.
These variables are an alternative to `PRE_RECOVERY_SCRIPT` and `POST_RECOVERY_SCRIPT` with the following differences:
* The earlier `PRE_RECOVERY_SCRIPT` and `POST_RECOVERY_SCRIPT` variables accept a single shell command. To pass multiple commands to these variables, you must separate the commands by semicolons.
* The new `PRE_RECOVERY_COMMANDS` and `POST_RECOVERY_COMMANDS` variables accept arrays of commands, and each element of the array is executed as a separate command.
As a result, providing multiple commands to be executed in the rescue system before and after recovery is now easier and less error-prone.
For more information, see the `default.conf` file.
|
Story Points: | --- | |
Clone Of: | ||||
: | 2111059 (view as bug list) | Environment: | ||
Last Closed: | 2022-11-08 10:02:43 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | 2111059 | |||
Bug Blocks: |
Description
Renaud Métrich
2021-12-28 09:30:27 UTC
Hi, thanks for the PR, I left a comment there. The current behavior is indeed a bit silly, but it seems to be what was intended (except for the handling of whitespace in arguments, which is probably not as intended, and with it the whole justification for using shell arrays disappears). So, I think it is better to introduce new variables with a better-defined behavior, and let the old ones slowly die. We now have a discussion upstream about other changes of semantics of POST_BACKUP. Would it be acceptable to do just the PRE/POST_RECOVERY part for now? Also, your opinion on whether to run the POST_BACKUP commands even after a failed backup is welcome (do you have more real-world scenaria than the one with DBMS stop/start?) A PR implementing the new syntax for PRE/POST_RECOVERY only has been merged. Is it acceptable to add only that and avoid any additions to PRE/POST_BACKUP ? Note that PR 2735 does not preserve the original semantics of exit task handling in PRE/POST_BACKUP_SCRIPT for PRE/POST_BACKUP_COMMANDS: POST_BACKUP_SCRIPT is executed on error only if PRE_BACKUP_SCRIPT is set, as noted in https://github.com/rear/rear/pull/2735#issuecomment-1145006984, while no such logic exists for POST_BACKUP_COMMANDS. Hi Pavel, I'm sorry I totally forgot this. Please do what you consider best here. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (rear bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:7654 |