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

Radek Vykydal rvykydal at redhat.com
Thu Jul 10 11:19:05 UTC 2014


Not that it makes much difference from your approach,
but I'd propose attached patch.

On 07/07/2014 10:29 AM, Radek Vykydal wrote:
> 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
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-network-make-copyFileToPath-more-robust-1117020.patch
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20140710/d52848d8/attachment.bin>


More information about the anaconda-patches mailing list