Merge ~enr0n/ubuntu/+source/systemd:ubuntu-kinetic into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-kinetic

Proposed by Nick Rosbrook
Status: Merged
Merged at revision: 467130b3696844bb1943782a54864dae691bce1d
Proposed branch: ~enr0n/ubuntu/+source/systemd:ubuntu-kinetic
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-kinetic
Diff against target: 65 lines (+20/-12)
3 files modified
debian/changelog (+17/-0)
debian/systemd-resolved.postinst (+3/-1)
debian/systemd.postinst (+0/-11)
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+429535@code.launchpad.net

Description of the change

When the systemd-resolved package split was merged from Debian, we missed some /etc/resolv.conf logic from systemd.postinst that was Ubuntu-specific. This caused regressions, including in image builds. In fact, the missing logic was added to fix a similar issue years ago (LP: #1712283).

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

If this worked before, it should work again...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 6dd0804..28bfe73 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,20 @@
6+systemd (251.4-1ubuntu4) kinetic; urgency=medium
7+
8+ * debian/systemd-resolved.postinst: copy existing /etc/resolv.conf on new installs (LP: #1988772)
9+ Commit 20bc8a37fa ("Always setup /etc/resolv.conf on new installations.")
10+ added logic to copy any existing /etc/resolv.conf to
11+ /run/systemd/resolve/stub-resolv.conf before creating the final symlink.
12+ When we merged the systemd-resolved package split changes from Debian,
13+ this logic was not replicated, which has caused regressions.
14+ Move the necessary pieces from systemd.postint to systemd-resolved.postinst
15+ to maintain the previous /etc/resolv.conf logic.
16+ Files:
17+ - debian/systemd-resolved.postinst
18+ - debian/systemd.postinst
19+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=a34a768a929921978a67ef2192ee787255400ee5
20+
21+ -- Nick Rosbrook <nick.rosbrook@canonical.com> Tue, 06 Sep 2022 19:39:59 -0400
22+
23 systemd (251.4-1ubuntu3) kinetic; urgency=medium
24
25 * Fix version of backported sd_hwdb_new_from_path symbol.
26diff --git a/debian/systemd-resolved.postinst b/debian/systemd-resolved.postinst
27index e6beb29..eea56d8 100644
28--- a/debian/systemd-resolved.postinst
29+++ b/debian/systemd-resolved.postinst
30@@ -25,10 +25,12 @@ if [ "$1" = configure ] && [ -z "$2" ]; then
31 _adopt_conffile /etc/systemd/resolved.conf systemd-resolved
32 fi
33
34-if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 251.4-1ubuntu2; then
35+if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 251.4-1ubuntu4; then
36 if [ "$(readlink "/etc/resolv.conf")" != "../run/systemd/resolve/stub-resolv.conf" ] && [ "$(readlink "/etc/resolv.conf")" != "/run/systemd/resolve/stub-resolv.conf" ]; then
37 echo "Converting /etc/resolv.conf to a symlink to /run/systemd/resolve/stub-resolv.conf..."
38+ mkdir -p "/run/systemd/resolve"
39 if [ -f "/etc/resolv.conf" ]; then
40+ cp "/etc/resolv.conf" "/run/systemd/resolve/stub-resolv.conf"
41 mv "/etc/resolv.conf" "/etc/.resolv.conf.systemd-resolved.bak" || echo "Cannot take a backup of /etc/resolv.conf."
42 fi
43 ln -sf ../run/systemd/resolve/stub-resolv.conf "/etc/resolv.conf" || echo "Cannot install symlink from /etc/resolv.conf to ../run/systemd/resolve/stub-resolv.conf"
44diff --git a/debian/systemd.postinst b/debian/systemd.postinst
45index 63e78ca..ec91aa8 100644
46--- a/debian/systemd.postinst
47+++ b/debian/systemd.postinst
48@@ -60,17 +60,6 @@ if dpkg --compare-versions "$2" lt "234-2ubuntu11~"; then
49 fi
50 fi
51
52-# Use stub resolve.conf by default on new installs
53-if [ -z "$2" ]; then
54- mkdir -p /run/systemd/resolve
55- if [ -e /etc/resolv.conf ]; then
56- cp /etc/resolv.conf /run/systemd/resolve/stub-resolv.conf
57- fi
58- # If /etc/resolv.conf is a bind-mount, moving or replacing
59- # /etc/resolv.conf may fail
60- ln -snf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf || true
61-fi
62-
63 # Enable systemd-pstore by default on new installs and upgrades, see #952767
64 if dpkg --compare-versions "$2" lt "245.4-4~"; then
65 systemctl enable systemd-pstore.service || true

Subscribers

People subscribed via source and target branches