Public bug reported:

As seen in
https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic/kinetic/amd64/p/postgresql-common/20220513_042035_38c41@/log.gz
postgresql-common autopkgtest suite have been failing with

# BEGIN LOGS

=== Running test 012_maintscripts.t ... ===
1..14
# We are running systemd
ok 1 - pg_createcluster 14 main --start
ok 2 - postmaster PID is 3634
ok 3 - dpkg-reconfigure --frontend=noninteractive postgresql-common
head: cannot open '/var/lib/postgresql/14/main/postmaster.pid' for reading: No 
such file or directory
not ok 4 - postmaster PID is 
not ok 5 - postmaster was not restarted
#   Failed test 'postmaster PID is '
#   at ./t/012_maintscripts.t line 32.
#   Failed test 'postmaster was not restarted'
#   at ./t/012_maintscripts.t line 33.
#          got: '3634'
#     expected: ''
ok 6 - pg_dropcluster 14 main --stop
# Cleanup
ok 7 - Cleanup: No clusters left behind
ok 8 - No postgres processes left behind
ok 9 - No files in /etc/postgresql left behind
ok 10 - No files in /var/lib/postgresql left behind
ok 11 - No files in /var/run/postgresql left behind
ok 12 - No files in /var/log/postgresql left behind
ok 13 - netstat -avptn 2>/dev/null | grep ":543[2-9]\b.*LISTEN"
ok 14 - PostgreSQL TCP ports are closed
# Looks like you failed 2 tests of 14.

# END LOGS

The test fails because, in Ubuntu, running

dpkg-reconfigure --frontend=noninteractive postgresql-common

results in a call to

deb-systemd-invoke stop 'postgresql.service',

stopping the service which the test expects to be up and running
(untouched).

This started happening after the following debhelper change introduced
in debhelper 13.6:

https://salsa.debian.org/debian/debhelper/-/commit/742b0c5ac8f4a6cfcd699f08915a8109a5ebec35

Which resulted in the following diff in the postgresql-common preinst
script:

# BEGIN DIFF

--- 238-comm/preinst    2022-02-10 07:02:57.000000000 -0300
+++ 241-comm/preinst    2022-05-11 10:57:04.000000000 -0300
@@ -16,7 +16,12 @@
         ;;
 esac
 
-# Automatically added by dh_installdeb/13.5.2ubuntu1
+# Automatically added by dh_installdeb/13.7.1ubuntu1
 dpkg-maintscript-helper rm_conffile 
/etc/apt/apt.conf.d/01autoremove-postgresql 229\~ postgresql-common -- "$@"
 # End automatically added section
+# 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
+# End automatically added section

# END DIFF

Tests passed in Debian as shown in
https://ci.debian.net/data/autopkgtest/testing/amd64/p/postgresql-common/21568780/log.gz

Note that it was using debhelper 13.7.1, which did introduce the new
snipped into the preinst script. Local autopkgtest runs for Debian also
succeed.

The reason for the test to fail in Ubuntu and pass in Debian lies in

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

which is applied in Ubuntu delta (but not in Debian).

A possible solution to the issue would be to introduce the "-r" (or
--no-stop-on-upgrade) option to  dh_installsystemd in Ubuntu's
postgresql-common d/rules. This should be enough to keep the expected
(old) behavior in the package maintainer scripts.

Then, if/once https://salsa.debian.org/pkg-
debconf/debconf/-/merge_requests/10 is merged, we can merge the delta in
Debian.

** Affects: postgresql-common (Ubuntu)
     Importance: Undecided
     Assignee: Athos Ribeiro (athos-ribeiro)
         Status: Triaged


** Tags: server-todo update-excuse

** Changed in: postgresql-common (Ubuntu)
       Status: New => Triaged

** Changed in: postgresql-common (Ubuntu)
     Assignee: (unassigned) => Athos Ribeiro (athos-ribeiro)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1973382

Title:
  autopkgtests failures due to debhelper 13.6 changes

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/1973382/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to