#3089 PR open: New RECOVERY_COMMANDS array

Labels: enhancement

jsmeix opened issue at 2023-11-21 14:26:

New RECOVERY_COMMANDS array that specifies the "rear recover" commands
which are automatically called after the ReaR recovery system has started up
to recreate the system in 'auto_recover'/'automatic' or 'unattended' mode.

Seems to work OK for me so far
with the defaults (in default.conf)
and also with (excerpt)

ISO_RECOVER_MODE=unattended
ISO_DEFAULT=automatic
RECOVERY_COMMANDS=( "echo 'rear -Dn recover' in $USER_INPUT_INTERRUPT_TIMEOUT seconds" "sleep $USER_INPUT_INTERRUPT_TIMEOUT" "rear -Dn recover" )
RECOVERY_COMMANDS_LABEL="rear -Dn recover"
REBOOT_COMMANDS=( "echo poweroff in $USER_INPUT_UNATTENDED_TIMEOUT seconds" "sleep $USER_INPUT_UNATTENDED_TIMEOUT" "poweroff" )
REBOOT_COMMANDS_LABEL="poweroff"
  • Description of the changes in this pull request:

In skel/default/etc/scripts/system-setup
added RECOVERY_COMMANDS (plus RECOVERY_COMMANDS_LABEL)
and in default.conf set and describe defaults
so that manual "rear recover" behaves as before.

jsmeix commented at 2023-11-22 15:55:

At least for me my current code in
[skel/default]/etc/scripts/system-setup
seems to work rather well (likely not yet perfect).

Because currently there is nothing in default.conf
for RECOVERY_COMMANDS I test with things like (excerpt)

#ISO_RECOVER_MODE=unattended
#ISO_DEFAULT=automatic
RECOVERY_COMMANDS=( 'echo rear $rear_options recover in $USER_INPUT_INTERRUPT_TIMEOUT seconds'
                    'sleep $USER_INPUT_INTERRUPT_TIMEOUT'
                    'rear $rear_options recover' )
RECOVERY_COMMANDS_LABEL='rear $rear_options recover'
REBOOT_COMMANDS=( 'echo poweroff in $USER_INPUT_UNATTENDED_TIMEOUT seconds'
                  'sleep $USER_INPUT_UNATTENDED_TIMEOUT'
                  'poweroff' )
REBOOT_COMMANDS_LABEL='poweroff'
#USER_INPUT_INTERRUPT_TIMEOUT=11
#USER_INPUT_UNATTENDED_TIMEOUT=7

pcahyna commented at 2023-11-23 15:30:

@jsmeix your PR should add a default value for RECOVERY_COMMANDS to default.conf, I suspect that that's why the CI tests are failing.

pcahyna commented at 2023-11-23 15:42:

I believe this will be very useful especially for automated testing. One will be able to inject flags like -D or -d, and even test another recovery system commands, like rear mountonly, or perform examination of the recovery system (saving logs etc).

jsmeix commented at 2023-11-27 06:35:

@pcahyna
currently there is nothing in default.conf for RECOVERY_COMMANDS
because currently this pull request is a work in progress draft.
Soon I will add defaults for RECOVERY_COMMANDS
and RECOVERY_COMMANDS_LABEL together with
a description what that thingy is good for...

jsmeix commented at 2023-11-27 11:39:

I will test with the defaults and if this works OK for me
I change it from "Draft" to "Ready for review".

jsmeix commented at 2023-11-29 06:35:

I tested with the defaults and it works well for me.

jsmeix commented at 2023-12-01 10:23:

@rear/contributors
I would like to merge it next Monday afternoon
unless there are objections.


[Export of Github issue for rear/rear.]