[Pkg-utopia-maintainers] Bug#1050498: pipewire-pulse systemd service not restarted despite dpkg upgrade of all pipewire packages

Boud Roukema bouddebbug at cosmo.torun.pl
Mon Aug 28 23:23:44 BST 2023


hi Dylan,

On Mon, 28 Aug 2023, Dylan Aïssi wrote:

> I think the bug you are describing is a kind of duplicate of #1027136 [1]
> filled against xdg-desktop-portal. So, I will quote the smcv's answer here [2]:
>
>>> I think (the) xdg-desktop-portal user service(s) should be stopped before
>>> removing the package. Is that possible?
>>
>> Not really: maintainer scripts happen in the context of the overall system
>> (as root) and there is not really a good way to inject service-management
>> commands into user sessions. Other per-user services like PulseAudio,
>> Pipewire, gpg-agent and so on are not stopped when you remove them either.

I see your point: from the system point of view, it's the user's responsibility
to know that if s/he upgrades pipewire, then s/he should either restart *all*
services running pipewire, or *none* of them (or live dangerously with a mix :P).

However, in that case, we should inform (at least) the user who knows
enough to look in the obvious place: /usr/share/docs/pipewire-pulse/; this
is currently empty except for 'copyright' and 'changelog.Debian.gz'.
At least one moderately experienced user (me) doesn't know much about
pipewire, and messed up. I assumed (incorrectly) that pipewire-pulse
would be automatically restarted if pipewire were restarted.

Here are two non-exclusive proposals.

PROPOSAL (1):

Should the user be informed when doing the system upgrade? More specifically,
would a one-line warning to the user be considered acceptable, as a post-install
script? E.g. something like:

"Please recommend that users restart all scripts running pipewire (such as pipewire, pipewire-pulse)"


PROPOSAL (2):

Add the following file (under the default licence for pipewire - Expat - no
need to complicate the licensing further):

cat > debian/pipewire-pulse.README.Debian << EOF 
Relation to pipewire and upgrades
=================================

The pipewire-pulse systemd service runs independently of the pipewire
service. Both run as user services and are not restarted when a
system-level upgrade is performed by the root user. If you wish to 
check that you restart pipewire-pulse whenever the pipewire is
upgraded using dpkg or apt, then consider using either 
"checkrestart" in the "debian-goodies" package [1] or "needrestart" [2].
These need to be run as root user, but aim to check for both
system and user services that need restarting.

[1] https://tracker.debian.org/pkg/debian-goodies
[2] https://tracker.debian.org/pkg/needrestart
EOF

My guess is that an extra file debian/pipewire-pulse.docs won't be
needed for this to be automatically installed. I tried both
checkrestart and needrestart, which both gave credible answers
(e.g. 'No user sessions are running outdated binaries.')


It's unclear to me if xdg-desktop-portal or other related programs
also need a similar debian/xdg-desktop-portal.README.Debian file.
After the udpate to pipewire 0.3.78 and restarting pipewire, 'pw-dump'
showed all the following as still being pipewire clients at version
0.3.77-1:

$ cat old-pw-dump | grep -n -B14 0\.3\.77 | sed -e "s/\(machine-id.\).*\'/\1: XXXXXXXXXXXXXXXX/"

659-    "type": "PipeWire:Interface:Client",
660-    "version": 3,
661-    "permissions": [ "r", "w", "x", "m" ],
662-    "info": {
663-      "change-mask": [ "props" ],
664-      "props": {
665-        "application.language": "C.UTF-8",
666-        "application.name": "xdg-desktop-portal",
667-        "application.process.binary": "xdg-desktop-portal",
668-        "application.process.host": "mobian",
669-        "application.process.id": 1685,
670-        "application.process.user": "mobian",
671-        "clock.power-of-two-quantum": true,
672-        "core.name": "pipewire-mobian-1685",
673:        "core.version": "0.3.77",
--
709-    "info": {
710-      "change-mask": [ "props" ],
711-      "props": {
712-        "application.language": "C.UTF-8",
713-        "application.name": "gsd-power",
714-        "application.process.binary": "gsd-power",
715-        "application.process.host": "mobian",
716-        "application.process.id": 1171,
717-        "application.process.machine-id": XXXXXXXXXXXXXXXX
718-        "application.process.user": "mobian",
719-        "client.api": "pipewire-pulse",
720-        "clock.power-of-two-quantum": true,
721-        "config.name": "pipewire-pulse.conf",
722-        "core.name": "pipewire-mobian-853",
723:        "core.version": "0.3.77",
--
759-    "info": {
760-      "change-mask": [ "props" ],
761-      "props": {
762-        "application.language": "C",
763-        "application.name": "CallAudio",
764-        "application.process.binary": "callaudiod",
765-        "application.process.host": "mobian",
766-        "application.process.id": 1040,
767-        "application.process.machine-id": XXXXXXXXXXXXXXXX
768-        "application.process.user": "mobian",
769-        "client.api": "pipewire-pulse",
770-        "clock.power-of-two-quantum": true,
771-        "config.name": "pipewire-pulse.conf",
772-        "core.name": "pipewire-mobian-853",
773:        "core.version": "0.3.77",
--
808-    "info": {
809-      "change-mask": [ "props" ],
810-      "props": {
811-        "application.language": "C",
812-        "application.name": "feedbackd",
813-        "application.process.binary": "feedbackd",
814-        "application.process.host": "mobian",
815-        "application.process.id": 1046,
816-        "application.process.machine-id": XXXXXXXXXXXXXXXX
817-        "application.process.user": "mobian",
818-        "client.api": "pipewire-pulse",
819-        "clock.power-of-two-quantum": true,
820-        "config.name": "pipewire-pulse.conf",
821-        "core.name": "pipewire-mobian-853",
822:        "core.version": "0.3.77",
--
1783-        "application.icon-name": "multimedia-volume-control",
1784-        "application.id": "org.gnome.VolumeControl",
1785-        "application.language": "C.UTF-8",
1786-        "application.name": "Phone Shell Volume Control",
1787-        "application.process.binary": "phosh",
1788-        "application.process.host": "mobian",
1789-        "application.process.id": 1008,
1790-        "application.process.machine-id": XXXXXXXXXXXXXXXX
1791-        "application.process.user": "mobian",
1792-        "application.version": "0.30.0",
1793-        "client.api": "pipewire-pulse",
1794-        "clock.power-of-two-quantum": true,
1795-        "config.name": "pipewire-pulse.conf",
1796-        "core.name": "pipewire-mobian-853",
1797:        "core.version": "0.3.77",
--
1835-        "application.icon-name": "multimedia-volume-control",
1836-        "application.id": "org.gnome.VolumeControl",
1837-        "application.language": "C.UTF-8",
1838-        "application.name": "GNOME Volume Control Media Keys",
1839-        "application.process.binary": "gsd-media-keys",
1840-        "application.process.host": "mobian",
1841-        "application.process.id": 1313,
1842-        "application.process.machine-id": XXXXXXXXXXXXXXXX
1843-        "application.process.user": "mobian",
1844-        "application.version": "",
1845-        "client.api": "pipewire-pulse",
1846-        "clock.power-of-two-quantum": true,
1847-        "config.name": "pipewire-pulse.conf",
1848-        "core.name": "pipewire-mobian-853",
1849:        "core.version": "0.3.77",


Which leads to

PROPOSAL (3)
Add the following file for the overall pipewire documentation:

cat >> debian/pipewire.README.Debian << EOF


After upgrading pipewire
========================

A system-level upgrade of pipewire will not automatically restart all
pipewire-related services. After an upgrade of pipewire, you may check
the output of "pw-dump" to see if you forgot to restart some services,
e.g.

   $ pw-dump |grep -nE "core\.(version|name)|process\.binary"

or you may use "checkrestart" [1] or "needrestart" [2] with
sudo or as root user.

[1] https://tracker.debian.org/pkg/debian-goodies
[2] https://tracker.debian.org/pkg/needrestart
EOF


Independent of proposals (1) + (2) + (3), the 'pw-dump'
output gives me the feeling that restarting pipewire
should force the restart of all the related services - but
I don't know how well they are expected to work together
when according to pw-dump they are using inconsistent
pipewire versions.

Leaving the wider question aside, are there any arguments
against proposals (1) or (2) or (3)?


Cheers
Boud


More information about the Pkg-utopia-maintainers mailing list