From 96b7895b99f9a1b6cda068799763ea842d8d741f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Oct 2020 11:52:07 +0200 Subject: [PATCH] Do not touch resolv.conf if it is a mountpoint https://bugzilla.redhat.com/show_bug.cgi?id=1885101 --- systemd.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/systemd.spec b/systemd.spec index ee64d30..85cd082 100644 --- a/systemd.spec +++ b/systemd.spec @@ -667,7 +667,8 @@ systemctl --global preset-all &>/dev/null || : # too before NetworkManager gets a chance. (systemd-tmpfiles invocation above # does not do this, because it's marked with ! and we don't specify --boot.) # https://bugzilla.redhat.com/show_bug.cgi?id=1873856 -if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then +if systemctl -q is-enabled systemd-resolved.service &>/dev/null && + ! mountpoint /etc/resolv.conf &>/dev/null; then ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf fi @@ -691,6 +692,7 @@ systemctl --no-reload preset systemd-resolved.service &>/dev/null || : if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then systemctl -q is-enabled NetworkManager.service 2>/dev/null && \ ! test -L /etc/resolv.conf 2>/dev/null && \ + ! mountpoint /etc/resolv.conf &>/dev/null && \ grep -q 'Generated by NetworkManager' /etc/resolv.conf 2>/dev/null && \ echo -e '/etc/resolv.conf was generated by NetworkManager.\nRemoving it to let systemd-resolved manage this file.' && \ mv -v /etc/resolv.conf /etc/resolv.conf.orig-with-nm && \