Issue with detecting new state in dhclient-enter-hooks.d/resolved
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
After upgrading to 19.10 I noticed that resolving hostnames stopped working.
Quick release, which package and version info:
root@caret:~# lsb_release -r
Release: 19.10
root@caret:~# dpkg -S /etc/dhcp/
systemd: /etc/dhcp/
root@caret:~# apt-cache policy systemd
systemd:
Installed: 242-7ubuntu3
Candidate: 242-7ubuntu3
Version table:
*** 242-7ubuntu3 500
500 http://
100 /var/lib/
The file /etc/resolv.conf was pointing to the local instance of systemd-resolved however there was no search line, indicating something wasn't quite right.
Restarting the systemd-resolved service did recreate /etc/resolv.conf with expected search line.
After much debugging, I've worked out what was going wrong.
The dhcp hook file /etc/dhcp/
This may also impact on tickets 1805183, 1832050, 1832053 and maybe others.
When doing the md5sum of the old and new state, the command is wrong. It isn't sending STDOUT (and optionally STDERR) to the temp file but rather putting the md5sum command into the background and then creating an empty file for both states. Which obviously isn't different, so systemd-resolved doesn't restart.
Quick diff of a working version (I'm not capturing STDERR but one can with "2>&1")
======= BEGIN PATCH =======
*** .brk-resolved-
--- resolved 2019-10-27 11:30:17.156381734 +1030
***************
*** 30,36 ****
! md5sum $statedir/
if [ -n "$new_domain_
[Resolve]
--- 30,36 ----
! md5sum $statedir/
if [ -n "$new_domain_
[Resolve]
***************
*** 55,61 ****
fi
! md5sum $statedir/
if ! cmp $oldstate $newstate; then
fi
--- 55,61 ----
fi
! md5sum $statedir/
if ! cmp $oldstate $newstate; then
fi
======= END PATCH =======
Also, the script removes the script removes the $oldstate file but doesn't remove the $newstate file.
Not sure how this made it through QA testing... But breaking DHCP client shouldn't happen like this.
ivan.
ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: network-manager 1.20.4-2ubuntu2
ProcVersionSign
Uname: Linux 5.3.0-19-generic x86_64
ApportVersion: 2.20.11-0ubuntu8
Architecture: amd64
Date: Sun Oct 27 11:48:33 2019
InstallationDate: Installed on 2017-04-21 (918 days ago)
InstallationMedia: Ubuntu-Server 17.04 "Zesty Zapus" - Release amd64 (20170412)
IpRoute:
default via 172.16.1.14 dev enp0s5
150.101.89.32/28 dev enp0s5 scope link
169.254.0.0/16 dev enp0s5 scope link metric 1000
172.16.1.0/24 dev enp0s5 proto kernel scope link src 172.16.1.120
IwConfig:
lo no wireless extensions.
enp0s5 no wireless extensions.
NetworkManager.
[main]
NetworkingEnab
WirelessEnable
WWANEnabled=true
ProcEnviron:
LANGUAGE=en_AU:en
TERM=vt100
PATH=(custom, no user)
LANG=en_AU.UTF-8
SHELL=/bin/bash
RfKill:
SourcePackage: network-manager
UpgradeStatus: Upgraded to eoan on 2019-10-26 (0 days ago)
nmcli-con:
nmcli-dev:
DEVICE TYPE STATE IP4-CONNECTIVITY IP6-CONNECTIVITY DBUS-PATH CONNECTION CON-UUID CON-PATH
enp0s5 ethernet unmanaged unknown unknown /org/freedeskto
lo loopback unmanaged unknown unknown /org/freedeskto
nmcli-nm:
RUNNING VERSION STATE STARTUP CONNECTIVITY NETWORKING WIFI-HW WIFI WWAN-HW WWAN
running 1.20.4 connected started unknown disabled enabled enabled enabled enabled
Status changed to 'Confirmed' because the bug affects multiple users.