Force preset of systemd-resolved on package upgrade

Just changing /etc/nsswitch.conf is pointless without this.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-07-26 15:59:50 +02:00
parent 11b1c53b97
commit a5acceb904

View File

@ -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 <zbyszek@in.waw.pl> - 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 <zbyszek@in.waw.pl> - 246~rc2-1
- New pre-release with incremental fixes