systemd-resolved constantly restarts on Bionic upgraded from Xenial
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Louis Bouchard | ||
Cosmic |
Won't Fix
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Low
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Low
|
Unassigned |
Bug Description
[Impact]
Log noise due to needless restart of resolved on lease expiry, maybe loss of cached state?
Application that require Name Resolution may fail while the service is being unnecessarily restarted
[Test case]
(1) Append make_resolv_conf to the end of the file, so it gets executed
(2) Execute the file with bash -x and different settings and ensure there are no restarts if the settings are the same, and that there are if settings change; for example:
sudo new_domain_
sudo new_domain_
=> no restart
sudo new_domain_
=> should restart
sudo new_domain_
=> no restart
sudo new_domain_
=> should restart
[Regression potential]
The change only restarts resolved when the settings change. If there's a bug in the logic, resolved might not be restarted when it should be. Also, since there will be less restarts of resolved, it will run longer, so if there are memory leaks they will become more apparent.
[other info]
this fix was included in the initial release of systemd for eoan, but the fix required the additional change in bug 1849608. Both the original patch plus that change (to avoid using bash-specific &>) are included in the b/d patch for this bug.
[Original bug report]
If a cloud server is upgraded from Xenial to Bionic, the dhclient system remains in place and any DHCP lease refreshes cause a needless restart of the system-resolved daemon
Nov 26 16:59:41 srv-qvjhx dhclient[825]: DHCPREQUEST of 10.226.209.106 on ens3 to 10.226.209.105 port 67 (xid=0x2bd41d7d)
Nov 26 16:59:41 srv-qvjhx dhclient[825]: DHCPACK of 10.226.209.106 from 10.226.209.105
Nov 26 16:59:41 srv-qvjhx systemd[1]: Stopping Network Name Resolution...
Nov 26 16:59:41 srv-qvjhx systemd[1]: Stopped Network Name Resolution.
Nov 26 16:59:41 srv-qvjhx systemd[1]: Starting Network Name Resolution...
Nov 26 16:59:41 srv-qvjhx systemd-
Nov 26 16:59:41 srv-qvjhx systemd-
Nov 26 16:59:41 srv-qvjhx systemd-
Nov 26 16:59:41 srv-qvjhx systemd-
Nov 26 16:59:41 srv-qvjhx systemd-
Nov 26 16:59:41 srv-qvjhx systemd[1]: Started Network Name Resolution.
Nov 26 16:59:41 srv-qvjhx systemd[1]: Starting resolvconf-
Nov 26 16:59:41 srv-qvjhx dhclient[825]: bound to 10.226.209.106 -- renewal in 1466 seconds.
Nov 26 16:59:41 srv-qvjhx systemd[1]: Started resolvconf-
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 4.4.0-139-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
CrashDB: ubuntu
Date: Mon Nov 26 16:17:52 2018
PackageArchitec
SourcePackage: ubuntu-
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Dimitri John Ledkov: Pending requested
-
Diff: 27 lines (+9/-1)1 file modifieddebian/extra/dhclient-enter-resolved-hook (+9/-1)
- Dimitri John Ledkov: Pending requested
-
Diff: 210 lines (+127/-2) (has conflicts)5 files modifieddebian/changelog (+70/-0)
debian/extra/dhclient-enter-resolved-hook (+9/-1)
debian/gbp.conf (+1/-1)
debian/patches/meson-rename-Ddebug-to-Ddebug-extra.patch (+41/-0)
debian/patches/series (+6/-0)
tags: | added: id-5c0011e969ed904c67dda9ee |
no longer affects: | ubuntu-release-upgrader (Ubuntu) |
Changed in systemd (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
tags: | added: patch |
Changed in systemd (Ubuntu Bionic): | |
status: | New → Confirmed |
Changed in systemd (Ubuntu Cosmic): | |
status: | New → Confirmed |
Changed in systemd (Ubuntu Disco): | |
status: | In Progress → Confirmed |
Changed in systemd (Ubuntu Bionic): | |
importance: | Undecided → Medium |
assignee: | nobody → Louis Bouchard (louis) |
status: | Confirmed → In Progress |
Changed in systemd (Ubuntu Eoan): | |
status: | New → Fix Released |
Changed in systemd (Ubuntu Focal): | |
status: | Triaged → Fix Released |
description: | updated |
Changed in systemd (Ubuntu Eoan): | |
status: | Fix Committed → Fix Released |
First of all, dhclient remaining in place is not a bug. Systems are not switching to netplan and networkd on upgrade.
The restart caused by /etc/dhcp/ dhclient- enter-hooks. d/resolved to tell systemd-resolved about new servers and search domains, and hence expected to happen (resolved does not support a reload action, hence restart). I'm not sure what the alternative would look like, maybe a bunch of busctl calls feeding that information to the running daemon via dbus?