dhcpcd-discuss

Re: blank resolv.conf

Roy Marples

Tue Nov 10 12:46:07 2020

On 10/11/2020 12:17, Jan Pohanka wrote:
So you've already said where you should look.

Sorry for my misunderstanding, now I got it. You are absolutely right.
I have had eth0 interface specified in /network/interfaces with dhcp
option, I just haven't realized that this is the thing. ifup in
busybox is a binary not a script so it was not obvious at first for me
that it is starting dhcpcd.

Our application used a command ifdown eth0 && ifup eth0 to reload
configuration or restart the interface when needed. What would be a
correct alternative using dhcpcd? dhcpcd -n?

dhcpcd -n will cause the interfaces to load a new configuration and rebind.

Here's the important bit - if you want to limit this to one or more interfaces specify them on the command line. If only one interface and dhcpcd is not already running in master mode then dhcpcd will start for that one interface only and could be the cause of the issue we are talking about.
You need to ensure that dhcpcd is started in master mode only first, or not at all.


Can you also tell me what would be a correct approach to test if a
dhcp request failed and fallback static was used? I need to recheck
this periodically.

In /etc/dhcpcd.exit-hook you could write this:

echo "profile = $profile" >/tmp/"dhcpcd-$ifname.profile"

And then look in that file to see the last profile used.

Or you could just take some action in the exit hook script based on the profile used.

Roy

Follow-Ups:
Re: blank resolv.confJan Pohanka
References:
blank resolv.confJan Pohanka
Re: blank resolv.confRoy Marples
Re: blank resolv.confJan Pohanka
Re: blank resolv.confRoy Marples
Re: blank resolv.confJan Pohanka
Re: blank resolv.confJan Pohanka
Re: blank resolv.confRoy Marples
Re: blank resolv.confJan Pohanka
Re: blank resolv.confRoy Marples
Re: blank resolv.confJan Pohanka
Re: blank resolv.confRoy Marples
Re: blank resolv.confJan Pohanka
Archive administrator: postmaster@marples.name