Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on recovery if REQUIRED_PROGS specified with absolute path #2206

Closed
adatum opened this issue Aug 11, 2019 · 6 comments
Closed

Error on recovery if REQUIRED_PROGS specified with absolute path #2206

adatum opened this issue Aug 11, 2019 · 6 comments
Assignees
Labels
bug The code does not do what it is meant to do fixed / solved / done
Milestone

Comments

@adatum
Copy link

adatum commented Aug 11, 2019

  • 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:
  1. Comment out the REQUIRED_PROGS line in /etc/rear/local.conf in the recovery environment before running rear recover.
  2. Use PROGS instead of REQUIRED_PROGS.
@jsmeix jsmeix self-assigned this Aug 12, 2019
@jsmeix jsmeix added documentation enhancement Adaptions and new features labels Aug 12, 2019
@jsmeix jsmeix added this to the ReaR v2.6 milestone Aug 12, 2019
@jsmeix
Copy link
Member

jsmeix commented Aug 12, 2019

@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
Copy link
Author

adatum commented Aug 12, 2019

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
Copy link
Member

gozora commented Aug 12, 2019

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
Copy link
Author

adatum commented Aug 12, 2019

@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 jsmeix modified the milestones: ReaR v2.6, ReaR v2.7 Apr 29, 2020
jsmeix added a commit that referenced this issue May 14, 2020
When checking for required programs also test for "basename program"
because when required programs are specified with absolute path
those programs appears in the ReaR recovery system in /bin/
so testing their original path would falsely fail during "rear recover",
see #2206
@jsmeix jsmeix added bug The code does not do what it is meant to do and removed documentation enhancement Adaptions and new features labels May 14, 2020
@jsmeix jsmeix modified the milestones: ReaR v2.7, ReaR v2.6 May 14, 2020
@jsmeix
Copy link
Member

jsmeix commented May 14, 2020

I think #2397 should fix this issue.

jsmeix added a commit that referenced this issue May 14, 2020
Update init/default/950_check_missing_programs.sh
When checking for required programs also test for "basename program"
because when required programs are specified with absolute path
those programs appear in the ReaR recovery system in /bin/
so testing their original path would falsely fail during "rear recover"
see #2206
@jsmeix
Copy link
Member

jsmeix commented May 14, 2020

With #2397 merged
this issue as described in its initial comment should be fixed.

But note
#2397 (comment)
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

@jsmeix jsmeix closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do fixed / solved / done
Projects
None yet
Development

No branches or pull requests

3 participants