From a5acceb904463b9049e792fc983397bcbef04186 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jul 26 2020 14:27:03 +0000 Subject: Force preset of systemd-resolved on package upgrade Just changing /etc/nsswitch.conf is pointless without this. --- diff --git a/systemd.spec b/systemd.spec index 5d8d553..c2b315b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -621,6 +621,18 @@ if [ $1 -eq 0 ] ; then >/dev/null || : fi +%triggerun -- systemd < 246~rc2-2 +# This is for upgrades from previous versions before systemd-resolved became the default. +systemctl --no-reload preset systemd-resolved.service &>/dev/null || : + +grep -q 'Generated by NetworkManager' /etc/resolv.conf 2>/dev/null && \ + echo -e '/etc/resolv.conf was generated by NetworkManager.\nConsider removing it to let systemd-resolved manage this file.' \ + || : + +if systemctl is-enabled systemd-resolved.service &>/dev/null; then + systemctl start systemd-resolved.service &>/dev/null; +fi + %post libs %{?ldconfig} @@ -776,6 +788,9 @@ fi %changelog * Sun Jul 26 2020 Zbigniew Jędrzejewski-Szmek - 246~rc2-2 - Make /tmp be 50% of RAM again (#1856514) +- Re-run 'systemctl preset systemd-resolved' on upgrades. + /etc/resolv.conf is not modified, by a hint is emitted if it is + managed by NetworkManager. * Fri Jul 24 2020 Zbigniew Jędrzejewski-Szmek - 246~rc2-1 - New pre-release with incremental fixes