Merge ~athos-ribeiro/ubuntu/+source/postgresql-common:lp1973382-no-stop-on-upgrade into ubuntu/+source/postgresql-common:ubuntu/devel

Proposed by Athos Ribeiro
Status: Merged
Merged at revision: 890ab3d4cfb7c3fbc275921c547d78cbc59b62c7
Proposed branch: ~athos-ribeiro/ubuntu/+source/postgresql-common:lp1973382-no-stop-on-upgrade
Merge into: ubuntu/+source/postgresql-common:ubuntu/devel
Diff against target: 44 lines (+10/-3)
3 files modified
debian/changelog (+6/-0)
debian/control (+2/-1)
debian/rules (+2/-2)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Canonical Server Pending
Review via email: mp+422669@code.launchpad.net

Description of the change

This is a fix proposal for LP: #1973382.

The proposed fix works around a postgresql-common test regression caused by the combination of the following changes:

- https://salsa.debian.org/debian/debhelper/-/commit/742b0c5ac8f4a6cfcd699f08915a8109a5ebec35
- https://salsa.debian.org/pkg-debconf/debconf/-/merge_requests/10/diffs#8c2015059db93e56eaf3ed8ea7a2c9bf142c0c8f_198_197

The first one results in a new snippet to be injected in the preinst script:

# Automatically added by dh_installsystemd/13.7.1ubuntu1
if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then
 deb-systemd-invoke stop 'postgresql.service' >/dev/null || true
fi

(this new snippet is also available in the debian package).

The second one results in the preinst script to be executed (hence, causing the new snippet to run) on dpkg-reconfigure calls.

One of the postgresql-common tests specifically checks for the service not to be stopped/restarted on dpkg-reconfigure runs.

While the test failure is Ubuntu-specific (due to the second change above being available in the Ubuntu delta), a change of behavior/regression will be seen in Debian upon package upgrades (when the preinst script runs).

A PPA with the proposed changes is available at https://launchpad.net/~athos-ribeiro/+archive/ubuntu/lp1973382-pgsql-common-restarts/+packages

Local DEP8 test suite run result summary:
autopkgtest [10:13:06]: @@@@@@@@@@@@@@@@@@@@ summary
default-psql PASS
run-testsuite PASS

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This is tricky, well done investigating the issue.

I did some tests, and dpkg-reconfigure now behaves as expected by the test, yet normal apt-get upgrades of the full postgresql stack do restart the service, which is something we did not want to lose.

This looks good, but please keep an eye on Dave's PR on debconf, to be aware of any other changes before this lands on debian, and if a different version will land in Ubuntu.

review: Approve
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Andreas!

Uploaded:

$ dput ubuntu ../postgresql-common_241ubuntu1_source.changes
D: Setting host argument.
Checking signature on .changes
gpg: ../postgresql-common_241ubuntu1_source.changes: Valid signature from 033C4CA276024834
Checking signature on .dsc
gpg: ../postgresql-common_241ubuntu1.dsc: Valid signature from 033C4CA276024834
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading postgresql-common_241ubuntu1.dsc: done.
  Uploading postgresql-common_241ubuntu1.tar.xz: done.
  Uploading postgresql-common_241ubuntu1_source.buildinfo: done.
  Uploading postgresql-common_241ubuntu1_source.changes: done.
Successfully uploaded packages.

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 ba3c385..949a7a0 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+postgresql-common (241ubuntu1) kinetic; urgency=medium
7+
8+ * d/rules: do not stop service on package upgrades. (LP: #1973382)
9+
10+ -- Athos Ribeiro <athos.ribeiro@canonical.com> Mon, 16 May 2022 09:58:44 -0300
11+
12 postgresql-common (241) unstable; urgency=medium
13
14 * Remove stats_temp_directory in PG 15.
15diff --git a/debian/control b/debian/control
16index 5654e32..091f394 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -1,7 +1,8 @@
20 Source: postgresql-common
21 Section: database
22 Priority: optional
23-Maintainer: Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org>
24+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
25+XSBC-Original-Maintainer: Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org>
26 Uploaders:
27 Martin Pitt <mpitt@debian.org>,
28 Christoph Berg <myon@debian.org>,
29diff --git a/debian/rules b/debian/rules
30index a4783e4..668e10f 100755
31--- a/debian/rules
32+++ b/debian/rules
33@@ -26,9 +26,9 @@ override_dh_auto_configure:
34
35 # do not (re)start postgresql.service on postgresql-common install/upgrades
36 override_dh_installinit:
37- dh_installinit -ppostgresql-common --name=postgresql -u'defaults 19 21' --no-start
38+ dh_installinit -ppostgresql-common --name=postgresql -u'defaults 19 21' --no-start --no-stop-on-upgrade
39 override_dh_installsystemd:
40- dh_installsystemd --no-start
41+ dh_installsystemd --no-start --no-stop-on-upgrade
42
43 override_dh_gencontrol:
44 dh_gencontrol -ppostgresql-server-dev-all -- -Vserver-dev-all-depends="$(foreach v,$(SUPPORTED_VERSIONS),postgresql-server-dev-$v,)"

Subscribers

People subscribed via source and target branches