Do not touch resolv.conf if it is a mountpoint
https://bugzilla.redhat.com/show_bug.cgi?id=1885101
This commit is contained in:
parent
14b2fafb36
commit
96b7895b99
@ -667,7 +667,8 @@ systemctl --global preset-all &>/dev/null || :
|
|||||||
# too before NetworkManager gets a chance. (systemd-tmpfiles invocation above
|
# 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.)
|
# does not do this, because it's marked with ! and we don't specify --boot.)
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1873856
|
# 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
|
ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||||
fi
|
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
|
if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then
|
||||||
systemctl -q is-enabled NetworkManager.service 2>/dev/null && \
|
systemctl -q is-enabled NetworkManager.service 2>/dev/null && \
|
||||||
! test -L /etc/resolv.conf 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 && \
|
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.' && \
|
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 && \
|
mv -v /etc/resolv.conf /etc/resolv.conf.orig-with-nm && \
|
||||||
|
Loading…
Reference in New Issue
Block a user