[Bug 1782275] Re: Conflict between resolvconf and systemd-resolved dhclient scripts
Daniel Richard G.
skunk at iskunk.org
Tue Apr 14 05:34:01 UTC 2020
This issue is still present in Ubuntu focal.
Here is what I see that needs to happen:
systemd: The /etc/dhcp/dhclient-enter-hooks.d/resolved script should be
renamed to something like 00resolved or aaa_resolved, so that other
packages that install scripts into that directory will have their
scripts override whatever definitions are in the "resolved" script. (It
is notable that the avahi-autoipd package installs a file named
"zzz_avahi-autoipd" into /etc/dhcp/dhclient-exit-hooks.d/, apparently so
that it always runs last.)
systemd: The "resolved" script itself is obviously a modified version of
the one shipped with resolvconf; a comment at the top still even names
the original project. There is a conditional at the top that checks for
the presence of /lib/systemd/systemd-resolved (exactly where the
original checks for /sbin/resolvconf), but this check is pointless---the
systemd-resolved file not only belongs to the same package as the
script, the package in question is systemd, which for all intents and
purposes cannot be removed. Instead, the check should be on whether
systemd-resolved is enabled, e.g.
if systemctl is-enabled systemd-resolved | fgrep -q enabled ; then
systemd: In general, the "resolved" script could use some cleanup,
particularly on removing bits related to resolvconf that do not apply to
systemd-resolved.
resolvconf: It may be worthwhile for this package to disable systemd-
resolved upon installation (and re-enable it upon renewal), as that
presumably would be the intent of anyone installing it.
** Tags added: focal
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to resolvconf in Ubuntu.
https://bugs.launchpad.net/bugs/1782275
Title:
Conflict between resolvconf and systemd-resolved dhclient scripts
Status in resolvconf package in Ubuntu:
Confirmed
Status in systemd package in Ubuntu:
Confirmed
Bug description:
I am setting up an Ubuntu 18.04 (bionic) system with ifupdown instead
of netplan, as the latter does not meet my needs. I am using
resolvconf to update /etc/resolv.conf from DHCP, as in earlier
releases.
Unfortunately, I am not seeing /etc/resolv.conf (actually a symlink to
/run/resolvconf/resolv.conf) being updated; it is only the boilerplate
from /etc/resolvconf/resolv.conf.d/head with no server information
appended. (My "base" and "tail" files are empty.)
I poked around the scripts in /etc, and believe I have found the
problem.
When resolvconf is installed, the following two files are present:
/etc/dhcp/dhclient-enter-hooks.d/resolvconf
/etc/dhcp/dhclient-enter-hooks.d/resolved
Both of these scripts define the make_resolv_conf() shell function.
What I am seeing is that dhclient runs these two scripts in the
(alphabetical) order shown, and as the resolved script runs second, it
overwrites the resolvconf version of the shell function with its own.
As a result, dhclient does not invoke the appropriate update command
for resolvconf, even though the hook script was installed correctly.
Normally, I would remove the package that is providing the "resolved"
script, but this package is systemd, which cannot be removed. I am not
sure which of the two packages (resolvconf or systemd) needs to make
an accommodation for the other, but it is clear that the current
approach does not work.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1782275/+subscriptions
More information about the foundations-bugs
mailing list