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
Recovery system libraries not consistent (e.g. when /lib64/noelision/libpthread is used kernel panics because init fails) #1494
Comments
@linuxstar2017 Nevertheless I try some guesswork: e205:~/rear.master # find /lib64 | wc -l 234 but in the matching ReaR recovery system I have only RESCUE e205:~ # find /lib64 | wc -l 71 In general the ReaR recovery system is by default very minimal @linuxstar2017 COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/ ) helps? RESCUE e205:~ # find /lib64 | wc -l 230 That looks better but it is still 4 files less /lib64/libfuse.so.2 -> /usr/lib64/libfuse.so.2 /lib64/libfuse.so.2.9.3 -> /usr/lib64/libfuse.so.2.9.3 /lib64/libss.so.2 -> /usr/lib64/libss.so.2 /lib64/libss.so.2.0 -> /usr/lib64/libss.so.2.0 It seems there is a general problem @linuxstar2017 onyl FYI COPY_AS_IS=(${COPY_AS_IS[@]} /lib64/noelision/) In almost all cases one must use quoted "${arr[@]}", cf. # Some variables are actually bash arrays and should be treated with care. # Use VAR=() to set an empty array. # Use VAR=( "${VAR[@]}" 'value' ) to add a fixed value to an array. # Use VAR=( "${VAR[@]}" "$var" ) to add a variable value to an array. # Whether or not the latter case works as intended depends on when and # how "$var" is set and evaluated by the Relax-and-Recover scripts. # In general using ${VAR[*]} is problematic and using ${VAR[@]} without # double-quotes is also problematic, see 'Arrays' in "man bash" and # see https://github.com/rear/rear/issues/1068 for some examples. |
@linuxstar2017 |
Sure ... denbvslnxs1:/lib64/noelision # ls Normally, you don't need it ! But in our case .. /etc/ld.so.conf need to have the "noelision" library path at first to prevent I sent you in parallel a mail (in German) with all the background ... |
@linuxstar2017 Additionally to really reproduce it it seems one needs |
l9995988:~ # cat /etc/ld.so.conf /lib64/noelision /usr/local/lib64 /usr/local/lib include /etc/ld.so.conf.d/*.conf # /lib64, /lib, /usr/lib64 and /usr/lib gets added # automatically by ldconfig after parsing this file. # So, they do not need to be listed. I have no clue of any free sw, which requires Tests for the EMC Networker Recovery need Just IMHO |
@linuxstar2017 |
I can reproduce it and I use always KEEP_BUILD_DIR="yes" so that I can 'chroot' into the ReaR recovery system I can reproduce it with COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/noelision/ ) I make a ReaR recovery system and e205:~/rear.master # usr/sbin/rear -d -D mkrescue ... Creating recovery/rescue system initramfs/initrd ... You should also rm -Rf /tmp/rear.mqtc7xtv52uuRgu e205:~/rear.master # chroot /tmp/rear.mqtc7xtv52uuRgu/rootfs/ bash-4.3# export LC_ALL=C LANG=C bash-4.3# ldd /bin/sort | grep pthread grep: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory bash-4.3# echo -e 'foo\nbar\nbaz' | sort sort: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory The working workaround without code changes is COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/ ) cf. "could you try if ... helps" in my above With that I get: e205:~/rear.master # usr/sbin/rear -d -D mkrescue ... Creating recovery/rescue system initramfs/initrd ... You should also rm -Rf /tmp/rear.ICBQgUUoYcvDCap e205:~/rear.master # chroot /tmp/rear.ICBQgUUoYcvDCap/rootfs/ bash-4.3# export LC_ALL=C LANG=C bash-4.3# ldd /bin/sort | grep pthread libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc6a7267000) bash-4.3# echo -e 'foo\nbar\nbaz' | sort bar baz foo The solution (which needs a fix in a ReaR script) is e205:~/rear.master # chroot /tmp/rear.mqtc7xtv52uuRgu/rootfs/ bash-4.3# export LC_ALL=C LANG=C bash-4.3# ldconfig -v | egrep 'noelision|pthread' ... /lib64/noelision: libpthread.so.0 -> libpthread-2.22.so bash-4.3# ldd /bin/sort | grep pthread libpthread.so.0 => /lib64/noelision/libpthread.so.0 (0x00007f295567a000) bash-4.3# echo -e 'foo\nbar\nbaz' | sort bar baz foo @linuxstar2017 COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/ ) also works for him with his particular backup program |
At the end of #ldconfig $v -r "$ROOTFS_DIR" >&2 || Error "Could not configure libraries with ldconfig" which would have helped in this case if it was enabled. With this line enabled and COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/noelision/ ) everything works for me. @linuxstar2017 COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/noelision/ ) Because - as ususal :-( - there is not any comment that explains git log -p --follow usr/share/rear/build/GNU/Linux/390_copy_binaries_libraries.sh shows that it was disabled via As far as I understand it the actually right solution seems |
commenting out ldconfig line * added new script rescue/GNU/Linux/55_copy_ldconfig.sh: copy the /etc/ld.so.conf* stuff to ROOTFS * added new script skel/default/etc/scripts/system-setup.d/01-run-ldconfig.sh: run ldconfig -X before dhclient gets started at boot time Fix for issue #772
We actually have usr/share/rear/build/default/980_verify_rootfs.sh which does a It seems to me that we should improve this test to be more thorough. At the moment it only checks |
Feedback: Perfect, that change solved the issue ! Server is now recovering .... Many thanks for your help, will now update the SR..... |
@linuxstar2017 COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/ ) or COPY_AS_IS=( "${COPY_AS_IS[@]}" /lib64/noelision/ ) plus in build/GNU/Linux/390_copy_binaries_libraries.sh ldconfig $v -r "$ROOTFS_DIR" >&2 || Error " ..." or did even both changes solve the issue? |
I reopen this issue because we still have a bug in ReaR @schlomo First and foremost I need some help how to implement correctly |
Sorry, I was explicit ... but agreed, only in the SR solution comment: ReaR adapted as per below: File: File: |
@jsmeix thanks. ATM I only can offer a wild guess: The way how ReaR copies libraries to the standard paths can mess up some setups to put "override" libraries in special paths. To be 100% correct we might have to:
|
@linuxstar2017 are you really sure it did not work with |
@gdha The addition of the library path was days before ... it was copied over (verified), |
@linuxstar2017 |
@gdha Add a topmost line # ldconfig -v | egrep 'libpthread|noelision' ... /lib64/noelision: libpthread.so.0 -> libpthread-2.22.so libpthread.so.0 -> libpthread-2.22.so # ldd /bin/sort | grep pthread libpthread.so.0 => /lib64/noelision/libpthread.so.0 I use /bin/sort as an example for a binary that is Then reproduce it as I described in It worked like that for 1,5 year already with commented line Simply put: |
@jsmeix @linuxstar2017 Thank you both for the clear explanation of the issue - now I'm following |
…y_at_the_end_of_copy_binaries_libraries Run ldconfig non mandatory at the end of 390_copy_binaries_liraries.sh to get a consitent libraries configuration in the recovery system to avoid issues like #1494 but do not treat a ldconfig failure as fatal (only report the failure but do not error out) so that it could still work for special cases as #772
With #1502 merged |
…overy_system_related_to_issue_1494 Verify required libraries in recovery system, cf. #1494 (comment) Now the recovery system tests in build/default/980_verify_rootfs.sh are mandatory. It is an Error if the tests cannot be run because the filesystem of the ROOTFS_DIR is mounted 'noexec'. For programs (i.e. files in a .../bin/... or .../sbin/... directory) a missing library in the recovery system is an Error.
O.K. let me ask more concrete ... what my customer need to know .... When is the SUSE SLES-supported ReaR package able to work If no ETA or PTF (customer would challenge, why ?), what according For the given scenario ... including /lib64/noelision, a bootable recovery image and Many thanks .... |
The fix is upstream: I do not understand why In general: The public ReaR upstream GitHub is The public ReaR upstream GitHub is the right place The public ReaR upstream GitHub does not replace |
@linuxstar2017 As @jsmeix said for ReaR packages from SLES itself you should open a software case at SuSE support center, and do not bother us with these kind of questions as we have nothing to say what SuSE does or has in the pipe-line with ReaR in their products. |
With #1521 merged |
Relax-and-Recover (ReaR) Issue Template
Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):
SLES12
legacy BIOS
ReaR ISO recovery image leads to a kernel kernel panic.
/init: error while loading shared library: libpthread.s0.0: cannot open shared object file
Problem can be reproduced on physical and virtual servers and also
with ReaR version 2.x, found on OBS
Even we adapted the rear conf to include /lib64/noelision (it is actually copied over),
libpthread is not found
Remove /lib64/noelision from /etc/ld.so.conf
Execute ldconfig
Create rescue ISO
The text was updated successfully, but these errors were encountered: