:: [DNG] bug in dhclient-script
Etusivu
Poista viesti
Vastaa
Lähettäjä: Rowland Penny
Päiväys:  
Vastaanottaja: dng@lists.dyne.org
Aihe: [DNG] bug in dhclient-script

OK, I was trying to get dhcp to put this line into resolv.conf:

option timeout:2 attempts:4

This entails creating a small script in /etc/dhcp/dhclient-enter-hooks.d/ called 'resolvoptions'

It doesn't work, I finally tracked the problem down to bug in /sbin/dhclient-script.

In the script there are these lines:

# The action starts here

# Invoke the local dhcp client enter hooks, if they exist.
run_hook /etc/dhcp/dhclient-enter-hooks
run_hookdir /etc/dhcp/dhclient-enter-hooks.d

The last line runs any script found in /etc/dhcp/dhclient-enter-hooks.d/ , in this case
'resolvoptions'.

The only problem is, it appears to add the line to the wrong resolv.conf!

Now you might be saying, how can it be the wrong resolv.conf? there is only one.
Well, as far as the script is concerned, there are two, the 'old' one and the 'new' one
that hasn't been created yet, so the line gets added (probably) to the 'old' resolv.conf.
The script then continues, part of which is creating a 'new' resolv.conf, this is then moved
over the 'old' resolv.conf, but without the line that was added to the 'old' resolv.conf.

The fix, turn the lines above into a function and then call it
immediately after the 'new' resolv.conf is moved into place.

Now, seeing as it seems that systemd is trying to take over dhcp
(systemd-networkd), should I report this to debian, or has Devuan got
anywhere to report bugs.

Rowland