#1514 PR merged: Verify required libraries in recovery system (related to issue 1494)

Labels: enhancement, fixed / solved / done

jsmeix opened issue at 2017-09-25 11:23:

@schlomo suggested in
https://github.com/rear/rear/issues/1494#issuecomment-330217766
what is implemented here.

jsmeix commented at 2017-09-25 12:42:

In its current form it still works for me regardless
that for me (on SLES12) by default some libraries
require other libraries that are missing:

# usr/sbin/rear -v mkrescue
...
Checking for binaries or libraries in the ReaR recovery system that require additional libraries
ReaR recovery system in '/tmp/rear.yH2NEsUbyyDbKRT/rootfs' may need some additional libraries, check /root/rear.master/var/log/rear/rear-e205.log for details
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
...
# echo $?
0

And in the log I get

2017-09-25 14:38:49.655398247 Including build/default/980_verify_rootfs.sh
...
2017-09-25 14:38:51.960476741 Checking for binaries or libraries in the ReaR recovery system that require additional libraries
2017-09-25 14:38:51.962249159 /usr/lib64/libsoftokn3.so requires additional libraries
        linux-vdso.so.1 (0x00007ffdf9dc2000)
        libsqlite3.so.0 => /usr/lib64/libsqlite3.so.0 (0x00007f1dec5c2000)
        libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f1dec395000)
        libplc4.so => not found
        libplds4.so => not found
        libnspr4.so => not found
        libpthread.so.0 => /lib64/noelision/libpthread.so.0 (0x00007f1dec176000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f1debf72000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f1debbcf000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555fbb9d7000)
        libplc4.so => not found
        libplds4.so => not found
        libnspr4.so => not found
2017-09-25 14:38:51.966144769 /usr/lib64/libnssutil3.so requires additional libraries
        linux-vdso.so.1 (0x00007ffdff32e000)
        libplc4.so => not found
        libplds4.so => not found
        libnspr4.so => not found
        libpthread.so.0 => /lib64/noelision/libpthread.so.0 (0x00007ff538bdb000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff538837000)
        /lib64/ld-linux-x86-64.so.2 (0x0000560719be5000)
2017-09-25 14:38:51.969956914 /usr/lib64/libnss3.so requires additional libraries
        linux-vdso.so.1 (0x00007ffcd28bb000)
        libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f4bd4394000)
        libplc4.so => not found
        libplds4.so => not found
        libnspr4.so => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007f4bd3ff0000)
        libplc4.so => not found
        libplds4.so => not found
        libnspr4.so => not found
        libpthread.so.0 => /lib64/noelision/libpthread.so.0 (0x00007f4bd3dd1000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e0c2672000)
2017-09-25 14:38:51.973804321 /usr/lib64/libnssdbm3.so requires additional libraries
        linux-vdso.so.1 (0x00007ffe23de9000)
        libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f9b0ff8a000)
        libplds4.so => not found
        libnspr4.so => not found
        libpthread.so.0 => /lib64/noelision/libpthread.so.0 (0x00007f9b0fd6c000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f9b0f9c9000)
        /lib64/ld-linux-x86-64.so.2 (0x00005635cf5c1000)
        libplc4.so => not found
        libplds4.so => not found
        libnspr4.so => not found
2017-09-25 14:38:51.977664713 /usr/lib64/rsyslog/im3195.so requires additional libraries
        linux-vdso.so.1 (0x00007ffe72d9e000)
        liblogging-rfc3195.so.0 => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007fcce2bdc000)
        /lib64/ld-linux-x86-64.so.2 (0x00005640111a8000)
2017-09-25 14:38:51.980758963 ReaR recovery system in '/tmp/rear.yH2NEsUbyyDbKRT/rootfs' may need some additional libraries, check /root/rear.master/var/log/rear/rear-e205.log for details

How it looks when a real binary has a missing library
(I removed $ROOTFS_DIR/usr/lib64/libsystemd.so.0.13.0):

# usr/sbin/rear mkrescue
/bin/ps requires additional libraries
        libsystemd.so.0 => not found
/bin/rpcbind requires additional libraries
        libsystemd.so.0 => not found
/bin/logger requires additional libraries
        libsystemd.so.0 => not found
/bin/dbus-daemon requires additional libraries
        libsystemd.so.0 => not found
/bin/rsyslogd requires additional libraries
        libsystemd.so.0 => not found
ERROR: ReaR recovery system in '/tmp/rear.dEksMHdzygFF2da/rootfs' not usable, check /root/rear.master/var/log/rear/rear-e205.log for details
Aborting due to an error, check /root/rear.master/var/log/rear/rear-e205.log for details
Terminated

jsmeix commented at 2017-09-26 13:10:

For now I accept that the current code fails
if file or directory names contain IFS characters, cf.
https://github.com/rear/rear/issues/1372

jsmeix commented at 2017-09-26 13:37:

I like to merge it in its current form because
I prefer to find the reason why (at least for me on SLES12)
by default some libraries require other libraries that are missing:
https://github.com/rear/rear/issues/1518

jsmeix commented at 2017-09-27 12:54:

For my own shameless self-praise:
That required libraries in recovery system verification
is the best thing since sliced bread because it helps
so much to find incomplete implementations, cf.
https://github.com/rear/rear/issues/1518#issuecomment-332510242


[Export of Github issue for rear/rear.]