A quick follow up in case someone else is looking at this: I submitted the issue and fix to the dracut project and the issue has been fixed in the repo.

https://github.com/dracutdevs/dracut/commit/22c8a5c73f3f5bea2e6020b63060774b79008847

Cheers,
Merlin


On 10/11/19 12:11 PM, CSCI Technician wrote:
Hi Thomas,

Found the bug causing my resolv.conf issue.

Dracut creates /run/initramfs/stat/etc/resolv.conf from /tmp/net.*.resolv.conf in the script write-ifcfg.sh.  A change was put in last year that sorts and uniques the resolv.conf file.  A side affect of this is that the source file /tmp/net.*.resolv.conf such as this:

search foo.com
nameserver 192.168.240.5
nameserver 10.200.8.97
nameserver 10.200.8.61

produces a resolv.conf that is exactly reversed in order which, in my case, causes name lookups to fail during imaging.

The change to dracut and code in question can be found here
https://github.com/dracutdevs/dracut/commit/ee18dd2b88d6767902d442baa92c95f7be69c265#diff-380be46cd9d6f3ba8e2dc14509fe5b86

I'll submit an issue/change to the dracut project but if anyone using FAI runs into the same issue (name lookup failures in the FAI remote log file)...

To fix the issue I did the following so that the contents is uniqued but not sorted:
291c291
<     done | sort -u > /run/initramfs/state/etc/resolv.conf
---
>     done | awk '!($0 in a) { a[$0]; print }' > /run/initramfs/state/etc/resolv.conf


"awk '!($0 in a) { a[$0]; print }'" is a slightly more readable/efficient version of "awk '!a[$0]++'" but either works.

For my FAI install, this change needed to be done in two places:
/srv/fai/nfsroot/usr/lib/dractu/modules.d/45ifcfg/write-ifcfg.sh
/srv/tftp/fai/initrd.img-4.*-amd64:/lib/dracut/hooks/pre-pivot/85-write-ifcfg.sh


thanks for all the assistance and helping me narrow this one down. Now I can proceed to my next step in upgrading my FAI server to buster.

Cheers,
Merlin.

On 10/9/19 12:57 PM, Thomas Lange wrote:
Hi Merlin,

if I understand your correct, the resolv.conf inside the nfsroot is
always correct.

Upgrading the nfsroot using -kvp did not rebuild the whole nfsroot, it
just upgraded it without changing resolv.conf

Using fai-make-nfsroot -fvp rebuilds the whole nfsroot.
But building the nfsroot just copies the /etc/resolv.conf from the FAI
install server into the nfsroot. This should/can not reverse the
order of the entries in resolv.conf.

When the client does a network installation using PXE it uses the
resolv.conf from the config space or from inside the nfsroot.
See lib/subroutines line 1066ff
We also use lib/create_resolv_conf which copies the resolv.conf from
the initrd (created by dracut) or loops through the list defined by
$DNSSRVS (which comes from the DHCP server and is created by ./lib/dhclient-perl).

The difference between 5.3.6 and 5.8.x may be that we copy the
resolv.conf from the config space nowadays. IIRC we did not that
before. But I'm not sure. Maybe the order of the nameserver in
$DNSSRVS was always reversed but noone had problems with it.

So, please check all resolv.conf versions (on the FAI server itself, in the
nfsroot, inside the initrd, on the client) and tell which are the
wrong version. Maybe change all cp commands of a resolv.conf to cp -v.
Also check the order of DNS servers in dhcpd.conf on your dhcp server.



--
Merlin Hansen
Department of Computing Science
Vancouver Island University
900 Fifth Street
Nanaimo BC  V9R 5S5
250-753-3245 x 2321
t...@csci.viu.ca

Antwort per Email an