[Note: against F22-branch, but installing rawhide content, that's how I hit the bug]
systemd changed to generate a symlink resolv.conf -> /run/networkd/resolv.conf which doesn't exist at installation time.
(What we should do at some point is tell NetworkManager to serialize its state into the installation root and get out of the business of writing these files directly)
https://bugzilla.redhat.com/show_bug.cgi?id=1116651
From: Colin Walters walters@verbum.org
systemd changed to generate a symlink resolv.conf -> /run/networkd/resolv.conf which doesn't exist at installation time.
We unlink only symlinks that point to outside the root.
What we should do at some point is tell NetworkManager to serialize its state into the installation root and get out of the business of writing these files directly
(Side node: since iutil.mkdirChain already tests whether the dir exists, I dropped a redundant test)
https://bugzilla.redhat.com/show_bug.cgi?id=1116651 --- pyanaconda/network.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py index f1b3ab8..c10b489 100644 --- a/pyanaconda/network.py +++ b/pyanaconda/network.py @@ -28,6 +28,7 @@ from pyanaconda import iutil import socket import os +import errno import time import threading import re @@ -913,10 +914,19 @@ def copyFileToPath(fileName, destPath='', overwrite=False): if not os.path.isfile(fileName): return False destfile = os.path.join(destPath, fileName.lstrip('/')) - if (os.path.isfile(destfile) and not overwrite): + exists = os.path.exists(destfile) + # As a special case, we always overwrite any symlinks that + # are broken. This mainly occurs in the case of systemd resolved + # and resolv.conf: https://bugzilla.redhat.com/show_bug.cgi?id=1116651 + if overwrite or (not exists and os.path.islink(destfile)): + try: + os.unlink(destfile) + except OSError, e: + if e.errno != errno.ENOENT: + raise + elif exists: return False - if not os.path.isdir(os.path.dirname(destfile)): - iutil.mkdirChain(os.path.dirname(destfile)) + iutil.mkdirChain(os.path.dirname(destfile)) shutil.copy(fileName, destfile) return True
I just force-pushed a new commit which only unlinks if it's a broken symlink. Haven't tested yet.
Can one of the admins verify this patch?
Closed.
Closing since this is an issue between systemd and NetworkManager, and we are not going to fix their problems in anaconda. For what it's worth, we worked around, in lorax, the issue of systemd-tmpfiles creating a bad resolv.conf at the time boot.iso is booted by not allowing systemd to create anything in /etc since none of what it tries to create does any good for systems with a stateful /etc.
anaconda-patches@lists.fedorahosted.org