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
diff --git a/debian/changelog b/debian/changelog
index 6dd0804..28bfe73 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
1systemd (251.4-1ubuntu4) kinetic; urgency=medium
2
3 * debian/systemd-resolved.postinst: copy existing /etc/resolv.conf on new installs (LP: #1988772)
4 Commit 20bc8a37fa ("Always setup /etc/resolv.conf on new installations.")
5 added logic to copy any existing /etc/resolv.conf to
6 /run/systemd/resolve/stub-resolv.conf before creating the final symlink.
7 When we merged the systemd-resolved package split changes from Debian,
8 this logic was not replicated, which has caused regressions.
9 Move the necessary pieces from systemd.postint to systemd-resolved.postinst
10 to maintain the previous /etc/resolv.conf logic.
11 Files:
12 - debian/systemd-resolved.postinst
13 - debian/systemd.postinst
14 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=a34a768a929921978a67ef2192ee787255400ee5
15
16 -- Nick Rosbrook <nick.rosbrook@canonical.com> Tue, 06 Sep 2022 19:39:59 -0400
17
1systemd (251.4-1ubuntu3) kinetic; urgency=medium18systemd (251.4-1ubuntu3) kinetic; urgency=medium
219
3 * Fix version of backported sd_hwdb_new_from_path symbol.20 * Fix version of backported sd_hwdb_new_from_path symbol.
diff --git a/debian/systemd-resolved.postinst b/debian/systemd-resolved.postinst
index e6beb29..eea56d8 100644
--- a/debian/systemd-resolved.postinst
+++ b/debian/systemd-resolved.postinst
@@ -25,10 +25,12 @@ if [ "$1" = configure ] && [ -z "$2" ]; then
25 _adopt_conffile /etc/systemd/resolved.conf systemd-resolved25 _adopt_conffile /etc/systemd/resolved.conf systemd-resolved
26fi26fi
2727
28if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 251.4-1ubuntu2; then28if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 251.4-1ubuntu4; then
29 if [ "$(readlink "/etc/resolv.conf")" != "../run/systemd/resolve/stub-resolv.conf" ] && [ "$(readlink "/etc/resolv.conf")" != "/run/systemd/resolve/stub-resolv.conf" ]; then29 if [ "$(readlink "/etc/resolv.conf")" != "../run/systemd/resolve/stub-resolv.conf" ] && [ "$(readlink "/etc/resolv.conf")" != "/run/systemd/resolve/stub-resolv.conf" ]; then
30 echo "Converting /etc/resolv.conf to a symlink to /run/systemd/resolve/stub-resolv.conf..."30 echo "Converting /etc/resolv.conf to a symlink to /run/systemd/resolve/stub-resolv.conf..."
31 mkdir -p "/run/systemd/resolve"
31 if [ -f "/etc/resolv.conf" ]; then32 if [ -f "/etc/resolv.conf" ]; then
33 cp "/etc/resolv.conf" "/run/systemd/resolve/stub-resolv.conf"
32 mv "/etc/resolv.conf" "/etc/.resolv.conf.systemd-resolved.bak" || echo "Cannot take a backup of /etc/resolv.conf."34 mv "/etc/resolv.conf" "/etc/.resolv.conf.systemd-resolved.bak" || echo "Cannot take a backup of /etc/resolv.conf."
33 fi35 fi
34 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"36 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"
diff --git a/debian/systemd.postinst b/debian/systemd.postinst
index 63e78ca..ec91aa8 100644
--- a/debian/systemd.postinst
+++ b/debian/systemd.postinst
@@ -60,17 +60,6 @@ if dpkg --compare-versions "$2" lt "234-2ubuntu11~"; then
60 fi60 fi
61fi61fi
6262
63# Use stub resolve.conf by default on new installs
64if [ -z "$2" ]; then
65 mkdir -p /run/systemd/resolve
66 if [ -e /etc/resolv.conf ]; then
67 cp /etc/resolv.conf /run/systemd/resolve/stub-resolv.conf
68 fi
69 # If /etc/resolv.conf is a bind-mount, moving or replacing
70 # /etc/resolv.conf may fail
71 ln -snf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf || true
72fi
73
74# Enable systemd-pstore by default on new installs and upgrades, see #95276763# Enable systemd-pstore by default on new installs and upgrades, see #952767
75if dpkg --compare-versions "$2" lt "245.4-4~"; then64if dpkg --compare-versions "$2" lt "245.4-4~"; then
76 systemctl enable systemd-pstore.service || true65 systemctl enable systemd-pstore.service || true

Subscribers

People subscribed via source and target branches