resolved: fix skipping of scriptlet on upgrades

We don't want to preset and we don't want to create the symlink either.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-06-16 18:32:28 +02:00
parent be0f563352
commit b764a2387b
1 changed files with 7 additions and 3 deletions

View File

@ -916,12 +916,16 @@ if [ $1 -eq 0 ] ; then
fi
%post resolved
[ $1 -gt 1 ] && exit 0
# Related to https://bugzilla.redhat.com/show_bug.cgi?id=1943263
if [ $1 -eq 1 ] && ls /usr/lib/systemd/libsystemd-shared-24[0-7].so &>/dev/null; then
if ls /usr/lib/systemd/libsystemd-shared-24[0-8].so &>/dev/null; then
echo "Skipping presets for systemd-resolved.service, seems we are upgrading from old systemd."
else
%systemd_post systemd-resolved.service
exit 0
fi
%systemd_post systemd-resolved.service
# Create /etc/resolv.conf symlink.
# We would also create it using tmpfiles, but let's do this here
# too before NetworkManager gets a chance. (systemd-tmpfiles invocation above