Merge ~mitchdz/ubuntu/+source/multipath-tools:mitch/manually_restart_multipathd_on_upgrade_to_systemd_only_package-lunar into ubuntu/+source/multipath-tools:ubuntu/lunar-devel

Proposed by Mitchell Dzurick
Status: Merged
Merged at revision: 3df8c085bc6f6e0b4bbc009cb17e0c4ebcf0c166
Proposed branch: ~mitchdz/ubuntu/+source/multipath-tools:mitch/manually_restart_multipathd_on_upgrade_to_systemd_only_package-lunar
Merge into: ubuntu/+source/multipath-tools:ubuntu/lunar-devel
Diff against target: 51 lines (+37/-0)
2 files modified
debian/changelog (+7/-0)
debian/multipath-tools.postinst (+30/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Canonical Server Reporter Pending
Canonical Server Pending
git-ubuntu import Pending
Review via email: mp+451738@code.launchpad.net

This proposal supersedes a proposal from 2023-09-20.

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

Thanks, some questions inline.

review: Needs Information
Revision history for this message
Mitchell Dzurick (mitchdz) :
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

I removed the extra systemctl --system daemon-reload >/dev/null || true

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Back to this today.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'm taking a step back and going back to the original bug[1] that started this rabbit hole, trying to understand how we ended up here.

1. https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/2000186

Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :
Download full text (7.4 KiB)

Hi Andreas, I did some testing on the current package. I did 3 tests here and I am satisfied with them. Let me know what you think. I did the following:

1. Testing restart on package upgrade
2. Installing a fresh package (no warning message here because dpkg compare is lt-nl)
3. Upgrading to a future package

-----

1. Testing restart on package upgrade

$ lxc shell launch ubuntu:lunar l --vm
$ alias lxcrun="lxc exec l --"
$ lxcrun dpkg -l multipath-tools | grep multipath-tools | awk '{print $3}'
$ lxcrun pidof multipathd
137
$ lxcrun add-apt-repository ppa:mitchdz/multipath-tools-2035098 -y
$ lxcrun apt install -y multipath-tools=0.8.8-1ubuntu2.2~lunar5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  kpartx
Suggested packages:
  multipath-tools-boot
The following packages will be upgraded:
  kpartx multipath-tools
2 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Need to get 365 kB of archives.
After this operation, 1024 B disk space will be freed.
Get:1 https://ppa.launchpadcontent.net/mitchdz/multipath-tools-2035098/ubuntu lunar/main amd64 kpartx amd64 0.8.8-1ubuntu2.2~lunar5 [30.4 kB]
Get:2 https://ppa.launchpadcontent.net/mitchdz/multipath-tools-2035098/ubuntu lunar/main amd64 multipath-tools amd64 0.8.8-1ubuntu2.2~lunar5 [335 kB]
Fetched 365 kB in 2s (167 kB/s)
(Reading database ... 57593 files and directories currently installed.)
Preparing to unpack .../kpartx_0.8.8-1ubuntu2.2~lunar5_amd64.deb ...
Unpacking kpartx (0.8.8-1ubuntu2.2~lunar5) over (0.8.8-1ubuntu2) ...
Preparing to unpack .../multipath-tools_0.8.8-1ubuntu2.2~lunar5_amd64.deb ...
Unpacking multipath-tools (0.8.8-1ubuntu2.2~lunar5) over (0.8.8-1ubuntu2) ...
Setting up kpartx (0.8.8-1ubuntu2.2~lunar5) ...
Setting up multipath-tools (0.8.8-1ubuntu2.2~lunar5) ...
The following warning from stopping multipathd.service is safe to ignore. See (LP: #2035098).
Warning: The unit file, source configuration file or drop-ins of multipathd.service changed on
 disk. Run 'systemctl daemon-reload' to reload units.
Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 145.
Removing obsolete conffile /etc/init.d/multipath-tools ...
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for libc-bin (2.37-0ubuntu2.1) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

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.
# lxcrun pidof multipathd
1959
# lxcrun systemctl status multipathd.{service,socket} | grep Active -B2

● multipathd.service - Device-Mapper Multipath Device Controller
     Loaded: loaded (/lib/systemd/system/multipathd.service; enabled; preset: enabled)
     Active: active (running) since Thu 2023-10-05 16:40:20 UTC; 1min 5s ago
--
○ multipathd.socket - multipathd control socket
 ...

Read more...

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Text suggestions, let me know what you think.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Thanks Andreas, I like your suggestions. I added them and formatted it a little differently. Also updated the bug report to mention the warning that will be seen when upgrading.

Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

+1 and sponsored

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 f4d999d..6f9fe26 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+multipath-tools (0.8.8-1ubuntu2.2) lunar; urgency=medium
7+
8+ * debian/multipath-tools.postinst: restart multipathd when upgrading from lt
9+ 0.8.8-1ubuntu2.2 (LP: #2035098)
10+
11+ -- Mitchell Dzurick <mitchell.dzurick@canonical.com> Wed, 20 Sep 2023 05:18:54 -0700
12+
13 multipath-tools (0.8.8-1ubuntu2.1) lunar; urgency=medium
14
15 * d/p/0018-libmpathpersist-fix-command-keyword-ordering.patch:
16diff --git a/debian/multipath-tools.postinst b/debian/multipath-tools.postinst
17new file mode 100644
18index 0000000..5ccb61c
19--- /dev/null
20+++ b/debian/multipath-tools.postinst
21@@ -0,0 +1,30 @@
22+#!/bin/sh
23+# postinst script for multipath-tools
24+#
25+# see: dh_installdeb(1)
26+
27+set -e
28+
29+FIXED=0.8.8-1ubuntu2.2
30+# The previous multipath-tools.prerm maintainer script did not stop the
31+# multipathd.service unit, therefore it needs to be stopped here for this
32+# specific upgrade case.
33+# "systemctl daemon-reload" is specifically not being called before
34+# deb-systemd-invoke because:
35+# a) it will be called later in the script, before multipathd.service is
36+# started, so let's not call it twice
37+# b) it has system-wide effects, like running all systemd generators again
38+# c) we don't really need the new multipathd.service unit file to stop the old
39+# running daemon. In fact, one could argue it's more correct to use the old
40+# unit file to stop the old daemon.
41+# This approach will generate a one-time warning that can be ignored.
42+if dpkg --compare-versions "$2" lt-nl "$FIXED"; then
43+ echo -n "The warning about having to reload systemd units can be safely" >&2
44+ echo " ignored. Please see LP: #2035098 for details." >&2
45+
46+ deb-systemd-invoke stop 'multipathd.service' >/dev/null || true
47+fi
48+
49+#DEBHELPER#
50+
51+exit 0

Subscribers

People subscribed via source and target branches