RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2097437 - [ReaR] vi command in rear recover environment hungs
Summary: [ReaR] vi command in rear recover environment hungs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: rear
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: David Jež
Šárka Jana
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-15 16:56 UTC by Pradeep Jagtap
Modified: 2022-11-15 11:48 UTC (History)
4 users (show)

Fixed In Version: rear-2.6-12.el9
Doc Type: Bug Fix
Doc Text:
.The `vi` command in ReaR no longer results in an infinite loop Previously, the ReaR rescue system did not contain the `vi` executable, only the `/bin/vi` script. As a consequence, the `/bin/vi` script caused an infinite loop when invoked. With this update, the ReaR rescue system contains the actual `vi` executable `/usr/libexec/vi`, and running the `vi` command no longer leads to an endless loop.
Clone Of:
Environment:
Last Closed: 2022-11-15 10:42:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rear rear pull 2822 0 None open Fix vi in the rescue system on Fedora and RHEL 9 2022-06-16 14:53:11 UTC
Red Hat Issue Tracker RHELPLAN-125374 0 None None None 2022-06-15 17:03:22 UTC
Red Hat Product Errata RHBA-2022:8246 0 None None None 2022-11-15 10:42:43 UTC

Description Pradeep Jagtap 2022-06-15 16:56:27 UTC
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

Comment 3 Pavel Cahyna 2022-06-16 10:04:47 UTC
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.

Comment 4 Pavel Cahyna 2022-06-16 10:59:29 UTC
> 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

Comment 5 Pavel Cahyna 2022-06-16 11:24:37 UTC
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).

Comment 6 eric_hagen 2022-06-20 19:40:16 UTC
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.

Comment 16 errata-xmlrpc 2022-11-15 10:42:27 UTC
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


Note You need to log in before you can comment on or make changes to this bug.