-
Notifications
You must be signed in to change notification settings - Fork 0
BCF-6450: Rear Recover hung on last stage for hours #76
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
base: develop
Are you sure you want to change the base?
BCF-6450: Rear Recover hung on last stage for hours #76
Conversation
- System-wide startup file /etc/profile or root initialization files (e.g. /root/.profile) may be broken or may block execution by spawning child processes. An additional check was added to ensure that running 'chroot /bin/bash --login -c <cmd>' works correctly; if not, the --noprofile option is used. Jira-Ref: BCF-6450: Rear Recover hung on last stage for hours
Jira-Ref: BCF-6450: Rear Recover hung on last stage for hours
Jira-Ref: BCF-6450: Rear Recover hung on last stage for hours
Jira-Ref: BCF-6450: Rear Recover hung on last stage for hours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses a critical issue where ReaR (Relax-and-Recover) recovery could hang indefinitely when system-wide startup files (e.g., /etc/profile or /root/.profile) in the restored system are broken or spawn blocking child processes. The solution introduces a new run_in_chroot wrapper function that tests whether a login shell can execute properly and falls back to using the --noprofile option if issues are detected.
Changes:
- Added
run_in_chroot()function inlib/linux-functions.shto wrap chroot calls with login shell detection and automatic fallback to--noprofile - Replaced 12 instances of direct
chroot $TARGET_FS_ROOT /bin/bash --login -ccalls withrun_in_chrootacross restore and finalize scripts - Added
USE_NOPROFILE_FOR_LOGIN_SHELLconfiguration variable to allow manual override of auto-detection behavior
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| usr/share/rear/lib/linux-functions.sh | Implements the new run_in_chroot() function with login shell detection, timeout mechanism, and automatic fallback to --noprofile option |
| usr/share/rear/conf/default.conf | Documents the new USE_NOPROFILE_FOR_LOGIN_SHELL configuration variable |
| usr/share/rear/restore/default/900_create_missing_directories.sh | Replaces direct chroot call with run_in_chroot for chown operations |
| usr/share/rear/restore/ZYPPER/default/950_grub2_mkconfig.sh | Replaces direct chroot call with run_in_chroot for grub2-mkconfig; contains typo "insinde" |
| usr/share/rear/restore/ZYPPER/default/970_set_root_password.sh | Replaces direct chroot call with run_in_chroot for password setting |
| usr/share/rear/restore/ZYPPER/default/980_initial_network_setup.sh | Replaces three direct chroot calls with run_in_chroot for network setup commands |
| usr/share/rear/restore/YUM/default/950_grub2_mkconfig.sh | Replaces direct chroot call with run_in_chroot for grub2-mkconfig; contains typo "insinde" |
| usr/share/rear/restore/YUM/default/970_set_root_password.sh | Replaces direct chroot call with run_in_chroot for password setting |
| usr/share/rear/restore/YUM/default/980_initial_network_setup.sh | Replaces three direct chroot calls with run_in_chroot for network setup commands |
| usr/share/rear/finalize/SUSE_LINUX/s390/660_install_grub2_and_zipl.sh | Replaces direct chroot call with run_in_chroot for bootloader installation |
| usr/share/rear/finalize/Linux-ppc64le/660_install_grub2.sh | Replaces three direct chroot calls with run_in_chroot for GRUB2 configuration and installation |
| usr/share/rear/finalize/Linux-i386/660_install_grub2.sh | Replaces three direct chroot calls with run_in_chroot for GRUB2 operations |
| usr/share/rear/finalize/Debian/i386/550_rebuild_initramfs.sh | Replaces direct chroot call with run_in_chroot for mdadm configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jira-Ref: BCF-6450: Rear Recover hung on last stage for hours
(e.g. /root/.profile) may be broken or may block execution by spawning
child processes. An additional check was added to ensure that running
'chroot /bin/bash --login -c ' works correctly; if not, the
--noprofile option is used.
Jira-Ref: BCF-6450: Rear Recover hung on last stage for hours