[Bug 2078555] Re: Upgrading from 22.04 to 24.04.01 breaks dnsmasq
Nick Rosbrook
2078555 at bugs.launchpad.net
Thu Jan 30 18:46:18 UTC 2025
I verified the ubuntu-release-upgrader portion of this by testing an
upgrade from jammy -> noble on a fresh LXD container:
root at j:~# systemctl disable --now systemd-resolved
Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service.
Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service.
root at j:~# sed -i 's/nameserver.*/nameserver 1.1.1.1/g' /etc/resolv.conf
root at j:~# apt install dnsmasq -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
dns-root-data dnsmasq-base
Suggested packages:
resolvconf
The following NEW packages will be installed:
dns-root-data dnsmasq dnsmasq-base
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 399 kB of archives.
After this operation, 1025 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dns-root-data all 2023112702~ubuntu0.22.04.1 [5136 B]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 dnsmasq-base amd64 2.90-0ubuntu0.22.04.1 [374 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 dnsmasq all 2.90-0ubuntu0.22.04.1 [19.7 kB]
Fetched 399 kB in 1s (509 kB/s)
Selecting previously unselected package dns-root-data.
(Reading database ... 34046 files and directories currently installed.)
Preparing to unpack .../dns-root-data_2023112702~ubuntu0.22.04.1_all.deb ...
Unpacking dns-root-data (2023112702~ubuntu0.22.04.1) ...
Selecting previously unselected package dnsmasq-base.
Preparing to unpack .../dnsmasq-base_2.90-0ubuntu0.22.04.1_amd64.deb ...
Unpacking dnsmasq-base (2.90-0ubuntu0.22.04.1) ...
Selecting previously unselected package dnsmasq.
Preparing to unpack .../dnsmasq_2.90-0ubuntu0.22.04.1_all.deb ...
Unpacking dnsmasq (2.90-0ubuntu0.22.04.1) ...
Setting up dnsmasq-base (2.90-0ubuntu0.22.04.1) ...
Setting up dns-root-data (2023112702~ubuntu0.22.04.1) ...
Setting up dnsmasq (2.90-0ubuntu0.22.04.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Scanning processes...
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root at j:~# systemctl status dnsmasq systemd-resolved
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2025-01-30 18:28:38 UTC; 15s ago
Process: 1802 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS)
Process: 1810 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
Process: 1819 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
Main PID: 1818 (dnsmasq)
Tasks: 1 (limit: 18947)
Memory: 612.0K
CPU: 28ms
CGroup: /system.slice/dnsmasq.service
└─1818 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,20326,8,2,e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Jan 30 18:28:38 j systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jan 30 18:28:38 j dnsmasq[1818]: started, version 2.90 cachesize 150
Jan 30 18:28:38 j dnsmasq[1818]: DNS service limited to local subnets
Jan 30 18:28:38 j dnsmasq[1818]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset no-nftset auth cryptohash DNSSEC loop-detect inotify dumpfile
Jan 30 18:28:38 j dnsmasq[1818]: reading /etc/resolv.conf
Jan 30 18:28:38 j dnsmasq[1818]: using nameserver 1.1.1.1#53
Jan 30 18:28:38 j dnsmasq[1818]: read /etc/hosts - 8 names
Jan 30 18:28:38 j systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
○ systemd-resolved.service - Network Name Resolution
Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd-resolved.service(8)
man:org.freedesktop.resolve1(5)
https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
Jan 30 17:01:45 j systemd[1]: Starting Network Name Resolution...
Jan 30 17:01:45 j systemd-resolved[319]: Positive Trust Anchors:
Jan 30 17:01:45 j systemd-resolved[319]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Jan 30 17:01:45 j systemd-resolved[319]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.>
Jan 30 17:01:45 j systemd-resolved[319]: Using system hostname 'j'.
Jan 30 17:01:45 j systemd[1]: Started Network Name Resolution.
Jan 30 18:21:41 j systemd[1]: Stopping Network Name Resolution...
Jan 30 18:21:41 j systemd[1]: systemd-resolved.service: Deactivated successfully.
Jan 30 18:21:41 j systemd[1]: Stopped Network Name Resolution.
root at j:~# do-release-upgrade --proposed
Checking for a new Ubuntu release
= Welcome to Ubuntu 24.04 LTS 'Noble Numbat' =
The Ubuntu team is proud to announce Ubuntu 24.04 LTS 'Noble Numbat'.
To see what's new in this release, visit:
https://wiki.ubuntu.com/NobleNumbat/ReleaseNotes
Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.
We hope you enjoy Ubuntu.
== Feedback and Helping ==
If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at
http://www.ubuntu.com/community/participate/
Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever. If you feel
that you have found a bug please read:
http://help.ubuntu.com/community/ReportingBugs
Then report bugs using apport in Ubuntu. For example:
ubuntu-bug linux
will open a bug report in Launchpad regarding the linux package.
If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:
http://help.ubuntu.com/community/InternetRelayChat
http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
http://www.ubuntuforums.org/
== More Information ==
You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:
http://www.ubuntu.com/
To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:
http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce
Continue [yN] y
Get:1 Upgrade tool signature [833 B]
Get:2 Upgrade tool [1277 kB]
Fetched 1278 kB in 0s (0 B/s)
authenticate 'noble.tar.gz' against 'noble.tar.gz.gpg'
extracting 'noble.tar.gz'
[screen is terminating]
root at j:~#
root at j:~# grep stub-resolver /var/log/dist-upgrade/main.log
2025-01-30 18:31:08,949 DEBUG systemd-resolved is not running, not disabling stub-resolver
2025-01-30 18:31:10,628 DEBUG systemd-resolved is not running, not disabling stub-resolver
2025-01-30 18:31:32,566 DEBUG systemd-resolved is not running, not disabling stub-resolver
root at j:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
After the upgrade, because the fix for systemd is not available (or in
jammy-proposed yet), systemd-resolved is started and enabled again.
However, the above demonstrates that ubuntu-release-upgrader did its
part by recognizing that systemd-resolved was not running, and hence
skipping the quirk.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-release-upgrader in
Ubuntu.
https://bugs.launchpad.net/bugs/2078555
Title:
Upgrading from 22.04 to 24.04.01 breaks dnsmasq
Status in Ubuntu:
Triaged
Status in dnsmasq package in Ubuntu:
Invalid
Status in systemd package in Ubuntu:
Invalid
Status in ubuntu-release-upgrader package in Ubuntu:
Invalid
Status in The Jammy Jellyfish:
New
Status in dnsmasq source package in Jammy:
Invalid
Status in systemd source package in Jammy:
In Progress
Status in ubuntu-release-upgrader source package in Jammy:
Invalid
Status in The Noble Numbat:
New
Status in dnsmasq source package in Noble:
Invalid
Status in systemd source package in Noble:
Won't Fix
Status in ubuntu-release-upgrader source package in Noble:
Fix Committed
Bug description:
[Impact]
During upgrades, systemd-resolved will be started and enabled, even if it was not previously. This is due to (a) the package split that made systemd-resolved its own package (during kinetic cycle, hence between jammy and noble), and (b)
an ubuntu-release-upgrader quirk that (re)starts systemd-resolved out of stub
mode during the upgrade to avoid DNS resolution failures during the upgrade.
[Test Plan]
The complete test plan requires the fixed version of systemd *and*
ubuntu-release-upgrader.
On a Jammy machine, install systemd from jammy-proposed:
$ cat > /etc/apt/sources.list.d/proposed.list << EOF
deb http://archive.ubuntu.com/ubuntu/ jammy-proposed main universe
EOF
$ cat <<EOF >/etc/apt/preferences.d/proposed-updates
Package: *
Pin: release a=jammy-proposed
Pin-Priority: 400
EOF
$ apt update && apt install -y -t jammy-proposed systemd
$ apt policy systemd
Then, disable systemd-resolved, and install dnsmasq:
$ systemctl disable --now systemd-resolved
$ sed -i 's/nameserver.*/nameserver 1.1.1.1/g' /etc/resolv.conf # Use any DNS server
$ apt install dnsmasq -y
$ systemctl status dnsmasq systemd-resolved
At this point, dnsmasq should be running, and systemd-resolved should
not. Now, we can run the upgrade:
$ do-release-upgrade --proposed
[...]
The upgrade should complete normally. At the end, systemd-resolved
should still be disabled/inactive, and dnsmasq should still be
running:
$ systemctl status dnsmasq systemd-resolved
[Where problems could occur]
systemd:
The patch is adding a new systemd.prerm. Any issues here would be seen
during package upgrades of systemd in/from Jammy. It is designed to
only run during upgrades to Noble from Jammy, so the scope is limited
there. If something did occur, it would be within the deb-systemd-
helper script, which would not be fatal to the systemd.prerm script
given the || true after the invocation.
ubuntu-release-upgrader:
The patch adds a call to systemctl is-active to check whether systemd-
resolved is running. If this was broken, systemd-resolved might be
started during the ugprade anyways. This would not lead to systemd-
resolved being enabled, though.
[Other information]
For the complete upgrade experience to be fixed for affected users,
both of these updates need to land. Hence, we should aim to release
these at the same time. However, having one fix but not the other
would not make the situation any worse.
[Original Description]
Was running Ubuntu 22.04 as home gateway/firewall with dnsmasq as
dns/dhcp server. Previous upgrade from Ubuntu 20.04 to 22.04 had
worked without issue.
After the upgrade to 24.04.01, systemd-resovled was automatically
enabled. The result was that after a reboot, dnsmasq failed to start,
as systemd-resolved had already bound to the necessary port. This in
turn meant that my entire home network lost connectivity as it was
dependant on dnsmasq running to provide both correct dns and dhcp
functionality.
Ideally, during the upgrade process, a check should be made for if
another dns/dhcp service is already enabled, and if so, not enable
systemd-resolved.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/2078555/+subscriptions
More information about the foundations-bugs
mailing list