Description of problem: ========================= /bin/vi hung in rear recover environment only was to exit is pressing Ctrl+C The /bin/vi script on the rear iso checks for the existence of vim incorrectly which causes an infinite loop Version-Release number of selected component (if applicable): ============================================================ rear-2.6-11.el9.x86_64 How reproducible: ================= Steps to Reproduce: 1. Boot system with rear rescue ISO 2. Use vi editor to edit the file Actual results: ================= vi hungs in rear rescue Expected results: ================== Should be able to use vi editor
The problem is in usr/share/rear/build/GNU/Linux/005_create_symlinks.sh : ln -sf $v vi $ROOTFS_DIR/bin/vim >&2 I think this line should be removed and vim added to PROGS.
> ln -sf $v vi $ROOTFS_DIR/bin/vim >&2 > > I think this line should be removed and vim added to PROGS. This solution indeed works. Steps to reproduce (almost) automatically: # echo 'PROGS+=( timeout )' >> /etc/rear/local.conf # rear -d mkrescue ... Testing that the recovery system in /var/tmp/rear.sewWahfi7dNgMlf/rootfs contains a usable system ... # chroot /var/tmp/rear.sewWahfi7dNgMlf/rootfs timeout 10 vi +q # echo $? # 124
If I only remove the /usr/bin/vim symlink and try to run vi, I get /usr/sbin/vi: line 23: /usr/libexec/vi: No such file or directory So checking for symlink is not enough, there is nothing to run if we don't want to execute the symlink. In addition to the proposed fix, I would also add /usr/libexec/vi to PROGS (in case vim is not there, for example).
Original RH ticket assigned to this report. Tested above with the same results. Currently vi is listed in the /usr/share/rear/conf/GNU/Linux.conf file under: # progs to take along vim is not defined anywhere.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (rear bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:8246