Release Engineering

Tasklist

FS#40266 - Empty resolv.conf after PXE boot

Attached to Project: Release Engineering
Opened by Maciej (loper) - Thursday, 08 May 2014, 09:28 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Monday, 18 January 2016, 04:17 GMT
Task Type Bug Report
Category ArchISO
Status Closed
Assigned To Gerardo Exequiel Pozzi (djgera)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I'm having problem with resolv.conf. After booting LiveCD (every version), sometimes it's empty. Problem occurs when using more than 1 interface and probably when one of them isn't connected. Mostly it takes place when I'm
booting Arch under ESXi 5.5.0 (but I think it occures under VirtualBox too). After running 'dhcpcd' resolv.conf is filled and has correct data. Adding 'copy_resolvconf=y' to kernel params doesn't help.
Also FYI: I'm using iPXE to boot this ISO.

Steps to reproduce:
1. Boot ArchLinux ISO on any machine (ie. virtual) with 2 or more NIC's
2. Log in as root and cat /etc/resolv.conf - it will be empty or containing
empty line
3. Try to ping any foreign domain, ie. google.com - it should fail
4. Run 'dhcpcd' and check if resolv.conf is filled correctly - fixed

It should work automatically, not by explicite calling 'dhcpcd or
systemctl start dhcpcd@'. Any ideas?
This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Monday, 18 January 2016, 04:17 GMT
Reason for closing:  No response
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 13 May 2014, 00:29 GMT
If resolv.conf is empty, there is something wrong in early dhcp negotiation. At some point this code must be replaced with systemd-networkd.
Comment by Maciej (loper) - Tuesday, 13 May 2014, 09:26 GMT
When the 'net hook' is showing data, which he gained from dhcp, every DNS item is filled correctly (as shown in: http://i60.tinypic.com/29qgv90.jpg). But when system boots, resolv.conf is empty, but should have the same values as the hook.
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 13 May 2014, 10:33 GMT
BOOTIF= cmdline is used?
what are the contents of /tmp/net-*.conf (in initramfs) in both cases? (use break=postmount cmdline)
Comment by Maciej (loper) - Tuesday, 13 May 2014, 11:09 GMT
I append 'ip=::: BOOTIF=${mac}', where ${mac} is mac-address from iPXE and 'ip=' is a MUST, 'cause 'archiso_nfs_srv' requires it.
In /tmp/net-eth1.conf are the same values as shown in the snapshot (IPV4DNS0, 1 and DNSDOMAIN are filled correctly).
Maybe this 'copy_resolvconf' parameter isn't working correctly. Where I can find any manual for IPCONFIG command used in the 'archiso_pxe_common' hook?
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 13 May 2014, 22:39 GMT
1) copy_resolvconf=y is by default, just copy /etc/resolv.conf from initramfs to real-root.
2) if /etc/resolv.conf on real-root is empty then also /etc/resolv.conf in initramfs is empty otherwise should be the default shipped with the package.

in code:
# setup DNS resolver
if [[ "${IPV4DNS0}" != "0.0.0.0" ]]; then
echo "nameserver ${IPV4DNS0}" > /etc/resolv.conf
fi
if [[ "${IPV4DNS1}" != "0.0.0.0" ]]; then
echo "nameserver ${IPV4DNS1}" >> /etc/resolv.conf
fi

and

if [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then
cp /etc/resolv.conf /new_root/etc/resolv.conf
fi
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 13 May 2014, 22:40 GMT Comment by Maciej (loper) - Wednesday, 14 May 2014, 09:36 GMT
Thanks for this README. Another very IMPORTANT thing is that this issue occures when virtual machine has more than 1 NIC. Maybe this line:

". /tmp/net-*.conf"

is causing problems? One file (ie. net-eth0.conf) has IPV4DNS0 and other (net-eth1.conf) has IPV4DNS0=0.0.0.0 and overrides this first?

Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 14 May 2014, 11:52 GMT
yes, this is the issue, this is because I asked for contents of /tmp/net-*.conf. Thanks for confirmation. (I am still waiting for them)

Loading...