Re: waitip doesn't seem to wait for an IP
Roy Marples
Tue Jan 19 13:01:37 2021
Hi Michael
On 18/01/2021 11:38, Michael Aldridge wrote:
I was recently debugging a problem with the metadata provider in
linuxkit and was able to track it down to the machine not having an IPv4
address, but having an IPv6 address. I was quite surprised by this, as
the config file provided to dhcpcd includes 'waitip 4' at the bottom
[1]. I figured perhaps because the --nobackground and -1 options were
also being passed this might interfere with the config file, so I passed
--waitip=4 to the task and rebooted. Again I observed that an IPv6
address was obtained and not an IPv4 one. I have since had success by
completely turning off IPv6 support in the boot-time one-shot service by
passing -4 to the command arguments, but this feels like a hack.
Is waitip not what I should be using here? It seems like what I want
from the man page, but dhcpcd is for sure not waiting on an IP in this
configuration, so I wonder if this isn't right. If this turns out to be
a bug I'm happy to writeup a more detailed inventory of how dhcpcd is
configured.
[1] https://github.com/linuxkit/linuxkit/blob/master/pkg/dhcpcd/dhcpcd.conf
Well, it looks like it should work fine.
Do you pass any extra stuff via the command line when starting dhcpcd?
Also, what version are you running?
Some debug logs may help as well.
Add this to the top of the config:
debug
logfile /var/log/dhcpdc.log
restart dhcpcd and the logfile should hopefully be verbose enough.
Roy
Archive administrator: postmaster@marples.name