#2206 Issue closed: Error on recovery if REQUIRED_PROGS specified with absolute path

Labels: bug, fixed / solved / done

adatum opened issue at 2019-08-11 23:19:

  • ReaR version ("/usr/sbin/rear -V"): 2.4

  • OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"): Fedora 30

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
    REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" /home/test/Downloads/borg-linux64 )

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device): x86_64

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot): UEFI

  • Description of the issue (ideally so that others can reproduce it):

ERROR: Cannot find required programs: /home/test/Downloads/borg-linux64

Upon recovery, ReaR gives an error and aborts when a required program is specified with an absolute path, which naturally may not exist in the recovery media.

The program, borg-linux64 is nevertheless present in the recovery media, though located in /bin as it should.

  • Workaround, if any:

  • Comment out the REQUIRED_PROGS line in /etc/rear/local.conf in the recovery environment before running rear recover.

  • Use PROGS instead of REQUIRED_PROGS.

jsmeix commented at 2019-08-12 13:01:

@adatum
as far as I know PROGS and REQUIRED_PROGS are only meant
to be used with plain program names, cf. usr/share/rear/conf/default.conf
https://github.com/rear/rear/blob/master/usr/share/rear/conf/default.conf
and all this way specified programs end up in /bin/ in the ReaR recovery system.

If you need to copy arbitrary files into the ReaR recovery system
use COPY_AS_IS.

I think how those variables are meant to be used could be better explained
in default.conf.

adatum commented at 2019-08-12 17:53:

I agree those variables could be explained better, as I struggled to tell the difference between COPY_AS_IS and PROGS. Does COPY_AS_IS put executables in /bin/ ?

I got the impression COPY_AS_IS is for copying libraries, though it's also unclear to me where they would end up being copied to in the rescue media, i.e. is the path preserved?

The documentation mentions that it is highly recommended to include the borg standalone executable, but it does not mention how to do this and which variable in default.conf to use. Ideally, it should be placed in /bin/ in the rescue media.

gozora commented at 2019-08-12 18:01:

The documentation mentions that it is highly recommended to include the borg standalone executable, but it does not mention how to do this and which variable in default.conf to use. Ideally, it should be placed in /bin/ in the rescue media.

Just click Install Borg backup link in the mentioned documentation.

Excerpt:

sudo cp borg-linux64 /usr/local/bin/borg
sudo chown root:root /usr/local/bin/borg
sudo chmod 755 /usr/local/bin/borg

and you are done, no need to include anything ...

V.

adatum commented at 2019-08-12 18:05:

@gozora I suppose that is an option, but that means using the standalone binary on the system. I would rather use the system package so that it gets automatically updated. The binary is just for including in ReaR rescue media without dealing with dependencies.

jsmeix commented at 2020-05-14 08:55:

I think https://github.com/rear/rear/pull/2397 should fix this issue.

jsmeix commented at 2020-05-14 10:20:

With https://github.com/rear/rear/pull/2397 merged
this issue as described in its initial comment should be fixed.

But note
https://github.com/rear/rear/pull/2397#issuecomment-628535963
that reads (excerpts):

REQUIRED_PROGS+=( /home/johannes/mypartprobe )
...
inside the recovery system
one cannot call /home/johannes/mypartprobe
because inside the recovery system one would have
to call plain mypartprobe or /bin/mypartprobe

[Export of Github issue for rear/rear.]