#892 Issue closed: No REQUIRED_PROGS in conf/GNU/Linux.conf

Labels: enhancement, cleanup, fixed / solved / done, minor bug

jsmeix opened issue at 2016-06-23 14:27:

Current rear master.

The PROGS array in usr/share/rear/conf/GNU/Linux.conf
lists so many basic tools (like bash grep cat) but there is no
REQUIRED_PROGS array in usr/share/rear/conf/GNU/Linux.conf

I wonder if it wouldn't be better to have
the basic tools in an REQUIRED_PROGS array?

jsmeix commented at 2016-06-28 11:41:

There is a predefined REQUIRED_PROGS array
in usr/share/rear/conf/default.conf that also contains
things like bash and grep but e.g. no cat
and no less ( cf. https://github.com/rear/rear/issues/755 )

gdha commented at 2016-10-03 11:14:

@jsmeix I don't believe this issue is a show stopper for a new release, right? Perhaps, we better move the milestone?

jsmeix commented at 2016-10-04 08:09:

This is certainly not a show-stopper for the 1.19 release.

gdha commented at 2018-05-30 08:08:

pushing fwd to 2.5

jsmeix commented at 2018-11-12 08:40:

I think with https://github.com/rear/rear/pull/1961 merged
it is a good first step into the right direction, cf.
https://github.com/rear/rear/pull/1961#issuecomment-437352262

I do not yet close this issue because I like to play around a bit more
how ReaR behaves during "rear mkrescue" when basic programs are missing.

jsmeix commented at 2018-11-12 09:34:

I had the dim feeling from the past that the checks
that intend to verify all REQUIRED_PROGS exist
are messy in current ReaR and I was right:

With REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" qqqq ) in local.conf
things somewhat work but do not work really well.

There are two checks with same code, one in usr/sbin/rear and
another one in prep/default/950_check_missing_programs.sh
and both are not fully right because:

1.)
In general there should not be duplicated code

2.)
The check in prep/default/950_check_missing_programs.sh
is too early for things like
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" cryptsetup dmsetup )
in layout/save/GNU/Linux/260_crypt_layout.sh or
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" "brctl" )
in rescue/GNU/Linux/310_network_devices.sh
because the 'prep' stage runs before the 'layout/save' and 'rescue' stages
so that it won't error out during "rear mkrescue" when
e.g. 'cryptsetup' or 'brctl' are required but do not exists.

3.)
In case of 2. it errors out too late when the user cannot fix things
during "rear recover" by the check in usr/sbin/rear

I will clean up the checks that verify all REQUIRED_PROGS exist...

jsmeix commented at 2018-11-12 10:57:

https://github.com/rear/rear/pull/1962 intends to solve the issues in
https://github.com/rear/rear/issues/892#issuecomment-437814334

jsmeix commented at 2018-11-14 08:54:

With https://github.com/rear/rear/pull/1962 merged
I consider this particular issue sufficiently fixed for now.

In the future we may find out that more programs
should be added to REQUIRED_PROGS by default, cf.
https://github.com/rear/rear/pull/1961#issuecomment-437352262

What we will need to improve is that specific scripts which result
that specific programs will be called in the recovery system
need to add those programs to REQUIRED_PROGS.

For example I have an ext4 root filesystem and did

# mv /usr/sbin/mkfs /usr/sbin/mkfs.away
# mv /usr/sbin/mkfs.ext4 /usr/sbin/mkfs.ext4.away

and "rear -D mkrescue" did not error out (or show any kind of message)
regardless that without mkfs and/or mkfs.ext4 in the recovery system

# find /tmp/rear.2VRqe2odrvdlsPY/rootfs | grep mkfs

/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.ext2
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.jfs
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.ext3
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.reiserfs
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.vfat
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.btrfs
/tmp/rear.2VRqe2odrvdlsPY/rootfs/bin/mkfs.xfs

# grep ext4 /tmp/rear.2VRqe2odrvdlsPY/rootfs/.../var/lib/rear/layout/disklayout.conf
# Filesystems (only ext2,ext3,ext4,vfat,xfs,reiserfs,btrfs are supported).
fs /dev/sda2 / ext4 uuid=aed8d81b-29bf-405e-9049-29a6c0e702d3 label= ...

the ext4 root filesystem cannot be recreated.


[Export of Github issue for rear/rear.]