#3465 PR merged: Set ReaR paths early in system-setup

Labels: bug, cleanup, fixed / solved / done

jsmeix opened issue at 2025-04-29 11:50:

  • Type: Bug Fix / Cleanup

Since
https://github.com/rear/rear/commit/44381c52f7eba66dd2897ab1f1d6a64aaecb94cb
there is in default.conf

SECRET_VARIABLES=( $( grep ... $SHARE_DIR/conf/default.conf ... ) )

which fails in etc/scripts/system-setup during

source /usr/share/rear/conf/default.conf ...

with this error message during recovery system startup

grep: /conf/default.conf: No such file or directory

because SHARE_DIR is not yet set in system-setup
but it gets set directly afterwards.

SECRET_VARIABLES is currently only used in lib/dump-workflow.sh
but "rear dump" is allowed inside the ReaR recovery system
so this issue could be a real bug.

  • Impact: Normal

  • How was this pull request tested?

Tested on my test VM and now ReaR recovery system startup
shows no longer an error message (and also "rear recover"
still "just works" for me).

  • Description of the changes in this pull request:

In skel/default/etc/scripts/system-setup
set ReaR path variables early because they are used
e.g. SHARE_DIR is used in default.conf
and use ReaR path variables (SHARE_DIR / CONFIG_DIR)
also in system-setup instead of hardcoded paths.

jsmeix commented at 2025-04-29 12:43:

@rear/contributors
I would like to merge it tomorrow afternoon
provided there are no objections.

gdha commented at 2025-04-29 14:05:

@jsmeix What was the content of /etc/rear/rescue.conf - perhaps we should add it in there?

jsmeix commented at 2025-04-30 11:20:

@gdha
I think today I won't find time for it and
tomorrow is public holiday in Germany
and I am on vacation on Friday
so (hopefully) next week...

Accordingly I postpone merging to next week.

jsmeix commented at 2025-05-05 13:28:

@gdha
my etc/rear/rescue.conf

# initialize our /etc/rear/rescue.conf file sourced by the rear command in recover mode
# also the configuration is sourced by system-setup script during booting our recovery image

BACKUP_PROG_OPTIONS=( --anchored --xattrs --xattrs-include=security.capability --xattrs-include=security.selinux --acls )
# The following 2 lines were added by 210_include_dhclient.sh
USE_DHCLIENT=yes
DHCLIENT_BIN=dhclient

# The following lines were added by 490_store_write_protect_settings.sh
WRITE_PROTECTED_IDS=(  )
WRITE_PROTECTED_FS_LABEL_PATTERNS=( )

# All set NETFS_* variables (cf. rescue/NETFS/default/600_store_NETFS_variables.sh):
NETFS_KEEP_OLD_BACKUP_COPY=
NETFS_PREFIX=localhost
NETFS_RESTORE_CAPABILITIES=([0]="No")

I do not understand what you mean with your question
https://github.com/rear/rear/pull/3465#issuecomment-2839063740

I.e. how is my change here related to the rescue.conf file?

jsmeix commented at 2025-05-05 14:49:

@rear/contributors
I would like to merge it tomorrow afternoon
provided there are no severe objections.


[Export of Github issue for rear/rear.]