[PATCH] network: Replace systemd resolv.conf link with regular file

Radek Vykydal rvykydal at redhat.com
Mon Jul 7 08:29:32 UTC 2014


On 07/07/2014 04:31 AM, Colin Walters wrote:
> [not tested yet, just got done with lorax build]
>
> We want to propagate our network configuration here, so unlink
> systemd's link to /run.

I wonder how does NetworkManager deal with the systemd's link
during installation?

> ---
>   pyanaconda/network.py | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/pyanaconda/network.py b/pyanaconda/network.py
> index 9d589bd..396a029 100644
> --- a/pyanaconda/network.py
> +++ b/pyanaconda/network.py
> @@ -1033,6 +1033,10 @@ def write_network_config(storage, ksdata,
> instClass, rootpath):
>       disableIPV6(rootpath)
>       copyIfcfgFiles(rootpath)
>       copyDhclientConfFiles(rootpath)
> +    # systemd may have created it as a symlink to /run, overwrite
> +    resolvpath = os.path.join("/etc/resolv.conf"

Something seems to be missing here.

> +    if os.path.islink(resolvpath) and not os.path.exists(resolvpath):
> +        os.unlink(resolvpath)
>       copyFileToPath("/etc/resolv.conf", rootpath,
>       overwrite=flags.livecdInstall)
>       instClass.setNetworkOnbootDefault(ksdata)
>       # NM_CONTROLLED is not mirrored in ksdata
>


Radek



More information about the anaconda-patches mailing list