#2929 Issue closed: Automatic recovery should not wait for user input

Labels: won't fix / can't fix / obsolete

schlomo opened issue at 2023-02-14 08:07:

ReaR 2.7

I think that there is no point in waiting 5 minutes for user input during fully automated recovery:
image
The "workaround" was of course hitting ENTER a couple of times, but that is exactly what I wouldn't want to do during automated recovery.

Later on, the system stays stuck waiting for the user to select 1, 2 or 3 where it should automatically reboot:
image

Or was this by design?

gdha commented at 2023-02-14 09:09:

@schlomo there is a TIMEOUT variable you can tune (see default.conf)

schlomo commented at 2023-02-14 09:26:

Yes, but shouldn't the TIMEOUT automatically be set to 0 in the case of an automated recovery?

jsmeix commented at 2023-02-14 10:15:

No, because that is too dangerous, cf.
https://github.com/rear/rear/issues/1271
In particular never ever automatically.

Automatic recovery means "without user interaction"
so (reasonable) timeouts let things still work
without user interaction.

It seems what you want is
"automatically and mercilessly and as fast as possible".
This is possible but it does not happen automatically.

See the description in default.conf about the
"Relax-and-Recover UserInput function default behaviour"
https://github.com/rear/rear/blob/rear-2.7/usr/share/rear/conf/default.conf#L240

In your case you recreate on a different disk
so ReaR goes by default into MIGRATION_MODE where it
asks for your confirmation where to recreate the system.
See the description in default.conf about MIGRATION_MODE
https://github.com/rear/rear/blob/rear-2.7/usr/share/rear/conf/default.conf#L397

Via the intentionally not explicitly documented

MIGRATION_MODE='false'

setting you can enforce recreating the disk layout
mercilessly as specified in disklayout.conf
(see rear/layout/prepare/default/250_compare_disks.sh)
by using the kernel device nodes as is in disklayout.conf
regardless what e.g. /dev/sda actually is inside
the ReaR recovery system, cf.
https://github.com/rear/rear/issues/1271
therein in particular see
https://github.com/rear/rear/issues/1271#issuecomment-290386444

schlomo commented at 2023-02-17 10:37:

After reading through much more of our code I came to understand that my question was ignorant to begin with.

https://github.com/rear/rear/blob/46d4dd3fe03595cc7b969db66d6ab1a881fcb6eb/usr/share/rear/conf/default.conf#L96-L98 explains it quite well and I agree that if the users chooses automatic recovery in the boot loaded then we don't need to reboot the system automatically.

Looking at our configuration we also have https://github.com/rear/rear/blob/46d4dd3fe03595cc7b969db66d6ab1a881fcb6eb/usr/share/rear/conf/default.conf#L951-L957 and also https://github.com/rear/rear/blob/46d4dd3fe03595cc7b969db66d6ab1a881fcb6eb/usr/share/rear/conf/default.conf#L1257-L1263

and maybe I just forgot about that stuff.

gdha commented at 2023-02-17 11:08:

E.g. from https://github.com/rear/rear/wiki/Test-Matrix-rear-2.6

OUTPUT=ISO
OUTPUT_URL=nfs://10.0.2.2/root/.config/VirtualBox/TFTP/isos
OUTPUT_OPTIONS="nfsvers=3,nolock"

BACKUP=BAREOS
BAREOS_RESTORE_JOB=client-restore
BAREOS_FILESET=client-fileset
BAREOS_RECOVERY_MODE="automatic"

PRE_BACKUP_SCRIPT=/usr/local/bin/client-backup-with-bareos

PROGS+=( showmount mount.nfs umount.nfs )
MODULES+=( nfs )
PRE_RECOVERY_SCRIPT="systemctl start rpcbind.target || rpcbind &"

PXE_CONFIG_URL=nfs://10.0.2.2/root/.config/VirtualBox/TFTP/pxelinux.cfg

ISO_DEFAULT="automatic"
ISO_RECOVER_MODE="unattended"

USE_STATIC_NETWORKING=y
KERNEL_CMDLINE="$KERNEL_CMDLINE net.ifnames=0"

FIRMWARE_FILES=( 'no' )

SSH_ROOT_PASSWORD="vagrant"

TIMESYNC=NTPDATE
TIMESYNC_SOURCE=0.pool.ntp.org
TEST_LOG_DIR_URL=nfs://10.0.2.2/export/rear-tests/logs/2020-05-26_15-14-17

[Export of Github issue for rear/rear.]