Skip to content
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

libsystemd-shared-252.so not found #3021

Open
LiamFry opened this issue Jun 27, 2023 · 10 comments
Open

libsystemd-shared-252.so not found #3021

LiamFry opened this issue Jun 27, 2023 · 10 comments

Comments

@LiamFry
Copy link

LiamFry commented Jun 27, 2023

Backup (rear -v mkbackup) reports that a necessary file is missing. I don't understand ...

  • ReaR version: Relax-and-Recover 2.7 / Git
  • OS version: Debian GNU/Linux 12 (bookworm)
  • ReaR configuration files: (attached)
  • System architecture: x86_64
  • Storage layout: (attached)
  • Description of the issue:
    I am not sure if this is a rear issue yet I cannot find any useful information elsewhere. (I've tried!) During backup, I get the following message ...
Testing that the recovery system in /var/tmp/rear.PvzABq2iZtXbVTm/rootfs contains a usable system
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-252.so requires additional libraries
        libsystemd-shared-252.so => not found
ReaR recovery system in '/var/tmp/rear.PvzABq2iZtXbVTm/rootfs' needs additional libraries, check /var/log/rear/rear-clara.log for details

dpkg --get-selections | grep libsystemd-shared shows that it's installed.
dpkg -L libsystemd-shared gives me the following ...

/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/systemd
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-252.so
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-252.so
/usr/share
/usr/share/doc
/usr/share/doc/libsystemd-shared
/usr/share/doc/libsystemd-shared/NEWS.Debian.gz
/usr/share/doc/libsystemd-shared/changelog.Debian.gz
/usr/share/doc/libsystemd-shared/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libsystemd-shared

All that said, a quick find / -name libsystemd-shared-252.so -ls reports this:

22458549 3252 -rw-r--r-- 1 root root 3327624 Feb 28 06:15 /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-252.so

local.conf.txt
storage-layout.txt

@jsmeix
Copy link
Member

jsmeix commented Jun 27, 2023

I am not a Debian user
so I cannot reproduce Debian specific issues.

In general when things are missing in the ReaR recovery system
you could manually add what is needed via something like

LIBS+=( /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-252.so )

or

LIBS+=( /usr/lib/x86_64-linux-gnu/systemd/*.so* )

in your etc/rear/local.conf file.

See the descriptions about LIBS and COPY_AS_IS
in usr/share/rear/conf/default.conf

@pcahyna
Copy link
Member

pcahyna commented Jun 27, 2023

I see a similar message on Fedora 37:

Testing that the recovery system in /tmp/rear.OBGH5kwM9RvJv5S/rootfs contains a usable system
There are binaries or libraries in the ReaR recovery system that need additional libraries
/usr/lib/systemd/libsystemd-core-251.14-2.fc37.so requires additional libraries
libsystemd-shared-251.14-2.fc37.so => not found

Weird.

@LiamFry
Copy link
Author

LiamFry commented Jun 27, 2023

A quick run of ldd /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-252.so did report that libsystemd-shared-252.so was missing. This is damned odd.
I took my question to the Debian forums. I'll post here what I discover.

@pcahyna
Copy link
Member

pcahyna commented Jun 27, 2023

Similar on Fedora 37:

# ldd /usr/lib/systemd/libsystemd-core-251.14-2.fc37.so 
        linux-vdso.so.1 (0x00007ffefb5d6000)
        libsystemd-shared-251.14-2.fc37.so => not found

libsystemd-shared-251.14-2.fc37.so is actually in /usr/lib/systemd .

@jsmeix
Copy link
Member

jsmeix commented Jun 27, 2023

I guess that the RequiredSharedObjects function in ReaR
does not get called for libsystemd-core-252.so
so libsystemd-shared-252.so is not automatically
included into the ReaR recovery system.

RequiredSharedObjects is called in
build/GNU/Linux/390_copy_binaries_libraries.sh
for all existing programs in PROGS and REQUIRED_PROGS
and for all libraries in LIBS via

local all_libs=( "${LIBS[@]}" $( RequiredSharedObjects "${all_binaries[@]}" "${LIBS[@]}" ) )

and RequiredSharedObjects is called in
build/GNU/Linux/100_copy_as_is.sh
for all executable files in COPY_AS_IS via

for required_library in $( RequiredSharedObjects "${copy_as_is_executables[@]}" ) ; do

So when libsystemd-core-252.so is not specified in LIBS
but gets included into the recovery system via COPY_AS_IS
and when libsystemd-core-252.so is not an executable file
then RequiredSharedObjects is not called for libsystemd-core-252.so
so libsystemd-shared-252.so gets not automatically included
and when libsystemd-shared-252.so is not explicitly
specified to be included into the recovery system
then libsystemd-shared-252.so is missing in the recovery system.

@jsmeix
Copy link
Member

jsmeix commented Jun 27, 2023

@pcahyna
Ah!
It seems the library configuration on the original system
(i.e. things like ldconfig and so on)
could be incomplete when ldd does not find it.

@jsmeix
Copy link
Member

jsmeix commented Jun 27, 2023

FYI:

On my current openSUSE Leap 15.4 system
I have systemd-249.16 which contains only
/usr/lib/systemd/libsystemd-shared-249.so
and I noticed no issues with that in ReaR.

After "rear -D mkrescue" I get:

# find /var/tmp/rear.Dw2DUk0fyAfXiN6/rootfs | grep libsystemd

/var/tmp/rear.Dw2DUk0fyAfXiN6/rootfs/usr/lib64/libsystemd.so.0
/var/tmp/rear.Dw2DUk0fyAfXiN6/rootfs/usr/lib64/libsystemd.so.0.32.0
/var/tmp/rear.Dw2DUk0fyAfXiN6/rootfs/usr/lib/systemd/libsystemd-shared-249.so

and my var/log/rear/rear-HOSTNAME.log contains

+ source /root/rear.github.master/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh
...
++ Log 'Adding required libraries of executables in all the copied files to LIBS'
...
2023-06-27 13:23:44.707937689 Adding required library '/usr/lib/systemd/libsystemd-shared-249.so' to LIBS
...
2023-06-27 13:23:45.113024540 Adding required library '/usr/lib64/libsystemd.so.0' to LIBS
.
.
.
+ source /root/rear.github.master/usr/share/rear/build/GNU/Linux/390_copy_binaries_libraries.sh
...
2023-06-27 13:23:53.056375594 Libraries being copied: ... /usr/lib/systemd/libsystemd-shared-249.so ... /usr/lib64/libsystemd.so.0 ...

As far as I see in particular in
usr/share/rear/prep/GNU/Linux/280_include_systemd.sh
and in usr/share/rear/conf/GNU/Linux.conf
it seems that
libsystemd-shared-249.so and libsystemd.so.0
are not specified in LIBS
but get included into the recovery system
via executables in COPY_AS_IS or
via programs in PROGS and REQUIRED_PROGS
which should normally be the preferred way
according to my reasoning in
#2743

@LiamFry
Copy link
Author

LiamFry commented Jun 28, 2023

I found this post that offered some "solutions." Even though the question was asked for Ubuntu, I found it helpful for Debian.

TL;DR

One-off solution:

sudo bash -c "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-252.so" rear -v mkbackup
(untested)

... OR ...

create an file in /etc/ld.so.conf.d
(This is the method I chose.)

I created /etc/ld.so.conf.d/libsystemd-core.conf
... into which I put /usr/lib/x86_64-linux-gnu/systemd
I then ran sudo ldconf

A run of ldd /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-252.so now resolves libsystemd-shared-252.so

I rebooted for good measure and ran a straight rear -v mkbackup -- it ran flawlessly.

I suppose why libsystemd-core-252.so has this issue is a question for the distro and subsystem teams.

@ekool
Copy link

ekool commented Aug 8, 2023

I just want to add that the above post from LiamFry fixed it for me as well.

@sid-the-sloth
Copy link

sudo ldconf

This solution from @LiamFry worked -- but on Debian should do sudo ldconfig instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants