Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#997818: wireplumber: Failed to preset unit, file /etc/systemd/user/pipewire-session-manager.service already exists

1,226 views
Skip to first unread message

Chris Halls

unread,
Oct 25, 2021, 6:40:03 AM10/25/21
to
Package: wireplumber
Version: 0.4.4-1
Severity: normal

Hi,

I had pipewire-media-session installed on this box and tried an upgrade
of pipewire. pipewire-media-session had to be removed due to lack of
dependencies, but it appears that was not enough to prevent it from
causing an issue with wireplumber:

Removing pipewire-media-session (0.3.38-2) ...
(Reading database ... 324735 files and directories currently installed.)
Preparing to unpack .../00-pipewire-pulse_0.3.39-1_amd64.deb ...
Unpacking pipewire-pulse (0.3.39-1) over (0.3.38-2) ...
[...]
Setting up libwireplumber-0.4-0:amd64 (0.4.4-1) ...
Setting up libpipewire-0.3-modules:amd64 (0.3.39-1) ...
Setting up libpipewire-0.3-dev:amd64 (0.3.39-1) ...
Setting up pipewire-bin (0.3.39-1) ...
Setting up pipewire:amd64 (0.3.39-1) ...
Setting up wireplumber (0.4.4-1) ...
Failed to preset unit, file /etc/systemd/user/pipewire-session-manager.service already exists and is a symlink to /lib/systemd/user/pipewire-media-session.service.
Created symlink /etc/systemd/user/pipewire.service.wants/wireplumber.service → /usr/lib/systemd/user/wireplumber.service.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on wireplumber.service: No such file or directory



-- System Information:
Debian Release: 11.1
APT prefers stable
APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'stable-security'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-9-amd64 (SMP w/16 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wireplumber depends on:
ii init-system-helpers 1.60
ii libc6 2.31-13+deb11u2
ii libglib2.0-0 2.66.8-1
ii libpipewire-0.3-0 0.3.39-1
ii libwireplumber-0.4-0 0.4.4-1
ii pipewire 0.3.39-1

Versions of packages wireplumber recommends:
ii pipewire-pulse 0.3.39-1

wireplumber suggests no packages.

-- no debconf information

Dylan Aïssi

unread,
Oct 25, 2021, 9:50:03 AM10/25/21
to
Hi Chris,

Thanks for your report!

Le lun. 25 oct. 2021 à 12:30, Chris Halls <ha...@debian.org> a écrit :
>
> Setting up wireplumber (0.4.4-1) ...
> Failed to preset unit, file /etc/systemd/user/pipewire-session-manager.service already exists and is a symlink to /lib/systemd/user/pipewire-media-session.service.
> Created symlink /etc/systemd/user/pipewire.service.wants/wireplumber.service → /usr/lib/systemd/user/wireplumber.service.
> /usr/bin/deb-systemd-helper: error: systemctl preset failed on wireplumber.service: No such file or directory
>

That was introduced by this commit:
> https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/1b48e068cee

i will discuss with upstream devs to see how we can solve that.

Best,
Dylan

Laurent Bigonville

unread,
Oct 29, 2021, 7:30:03 PM10/29/21
to
On Mon, 25 Oct 2021 15:44:31 +0200 =?UTF-8?B?RHlsYW4gQcOvc3Np?=
<dai...@debian.org> wrote:
> Hi Chris,
>
> Thanks for your report!
>
> Le lun. 25 oct. 2021 à 12:30, Chris Halls <ha...@debian.org> a écrit :
> >
> > Setting up wireplumber (0.4.4-1) ...
> > Failed to preset unit, file
/etc/systemd/user/pipewire-session-manager.service already exists and is
a symlink to /lib/systemd/user/pipewire-media-session.service.
> > Created symlink
/etc/systemd/user/pipewire.service.wants/wireplumber.service →
/usr/lib/systemd/user/wireplumber.service.
> > /usr/bin/deb-systemd-helper: error: systemctl preset failed on
wireplumber.service: No such file or directory
> >
>
> That was introduced by this commit:
> >
https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/1b48e068cee
>

That looks like a debian bug, not an upstream one,
pipewire-media-session package should cleaned up that symlink on purge,
but here, the package is "just" removed.

That also looks RC to me, leaving a dangling symlink is never good, not
too sure how to fix this.

Michael Biebl

unread,
Oct 29, 2021, 7:50:02 PM10/29/21
to

Am 30.10.2021 um 01:21 schrieb Laurent Bigonville:
> That also looks RC to me, leaving a dangling symlink is never good, not
> too sure how to fix this.

This preserves the enablement state of the service, similar to how
conffiles are removed on "apt remove".
Only if you purge a package, its conffiles are removed (and its systemd
enablement state)

Are you saying this is not the correct way?

Michael Biebl

unread,
Oct 30, 2021, 3:30:04 AM10/30/21
to
On 30.10.21 01:37, Michael Biebl wrote:
>
> Am 30.10.2021 um 01:21 schrieb Laurent Bigonville:
>> That also looks RC to me, leaving a dangling symlink is never good,
>> not too sure how to fix this.
>
> This preserves the enablement state of the service, similar to how
> conffiles are removed on "apt remove".

are *not* removed on "apt remove"



OpenPGP_signature

Laurent Bigonville

unread,
Oct 30, 2021, 3:40:03 AM10/30/21
to
Well, my understanding was that pipewire-media-session was gone for good
from the archive and that wireplumber was replacing it (and force
removing the package). In that condition, having some code to handle the
pipewire-session-manager.service symlinks sounded the think to do.

But, now I see that pipewire-media-session is being reintroduced
(#997001) meaning that we'll have two ways to start pipewire in the archive?

Diederik de Haas

unread,
Feb 10, 2022, 4:50:03 PM2/10/22
to
Control: found -1 0.4.8-2

First I'll describe what I tried to do and I'll attach the console output (as
it's rather long), so you can see what exactly I did.

I'm setting up a Rock64 device (arm64) cleanly with pipewire (so no PA which
my 'soundserver' device was previously running), so I installed that and with
it came pipewire-media-session as default recommended option of pipewire-bin.

Through the #pipewire IRC channel I understood that pipewire-media-session is
'soon' to be actually deprecated with the release of wireplumber 0.4.8, so I
figured I'd best switch now as I still need to setup/configure the device.

That's when I ran into this issue.
It didn't seem to be marked as a fatal flaw, so it appears that it concluded
the install ... but in what exact state it is in ... I do not know.
That device has 'bookworm' configured as default release, but sid is also
available.

As I wanted the 0.4.8-2 version, I then upgraded wireplumber to the sid
version, which ones again produced the error of this bug report. It however
did not also upgrade libwireplumber-0.4-0, which I expect it should?
IOW: should there be a (more) tight version dependency between those?

As I didn't like the unknown state that device was in wrt pipewire/
wireplumber, I purged both packages with the plan to then install pipewire and
wireplumber together (explicitly), so it would not install
pipewire-media-session and I expected that I would not run into this issue.
That turned out to be an incorrect expectation as the previous purge didn't
clean up things in /etc/systemd/user/ which still contains 3 symlinks which
point to /dev/null and one link which points to /usr/lib/systemd/user/
pipewire-media-session.service ... which doesn't exist (anymore).
There's also a /etc/systemd/user/pipewire.service.wants/ directory, which
contains the same link to that non-existing file and a link to
/usr/lib/systemd/user/wireplumber.service which also didn't exist anymore
(after another purge, in this case of both pipewire and wireplumber)

AFAIK a purge should cleaned it all up and 'aptitude install wireplumber
pipewire' should've succeeded (cleanly), but it did not.
I think the priority of this bug should be increased to possibly RC level as
otherwise many more systems will end up with a 'broken' pipewire/wireplumber/
pipewire-media-session configuration which will make it more difficult to
'recover' from.
And if I did understand correctly that with wireplumber 0.4.8 it should
actually replace pipewire-media-session, it may also be a good idea to reverse
the optional recommends so that wireplumber does get installed by default now.

Cheers,
Diederik
bug-997818-wireplumber-install-errors.txt
signature.asc

Diederik de Haas

unread,
Feb 10, 2022, 5:40:04 PM2/10/22
to
On Thursday, 10 February 2022 22:37:51 CET Diederik de Haas wrote:
> That turned out to be an incorrect expectation as the previous purge didn't
> clean up things in /etc/systemd/user/

Turns out there's more that I've now manually removed, namely in
default.target.wants and sockets.target.wants in /etc/systemd/user:

root@cs03:/etc/systemd/user# ls -lh
total 12K
drwxr-xr-x 2 root root 4.0K Feb 10 21:43 default.target.wants
lrwxrwxrwx 1 root root 9 Feb 10 02:12 pipewire-media-session.service -> /dev/null
lrwxrwxrwx 1 root root 9 Feb 10 21:43 pipewire-pulse.service -> /dev/null
lrwxrwxrwx 1 root root 9 Feb 10 21:43 pipewire-pulse.socket -> /dev/null
drwxr-xr-x 2 root root 4.0K Feb 10 02:12 pipewire.service.wants
lrwxrwxrwx 1 root root 52 Jan 27 00:38 pipewire-session-manager.service -> /usr/lib/systemd/user/pipewire-media-session.service
drwxr-xr-x 2 root root 4.0K Feb 10 21:43 sockets.target.wants
root@cs03:/etc/systemd/user# rm -rf pipewire*
root@cs03:/etc/systemd/user# ls -lh
total 8.0K
drwxr-xr-x 2 root root 4.0K Feb 10 21:43 default.target.wants
drwxr-xr-x 2 root root 4.0K Feb 10 21:43 sockets.target.wants
root@cs03:/etc/systemd/user# ls -lh default.target.wants/
total 0
lrwxrwxrwx 1 root root 44 Feb 10 21:42 pipewire-pulse.service -> /usr/lib/systemd/user/pipewire-pulse.service
root@cs03:/etc/systemd/user# rm -rf default.target.wants/
root@cs03:/etc/systemd/user# ls -lh sockets.target.wants/
total 0
lrwxrwxrwx 1 root root 36 Feb 10 02:17 dirmngr.socket -> /usr/lib/systemd/user/dirmngr.socket
lrwxrwxrwx 1 root root 46 Feb 10 02:17 gpg-agent-browser.socket -> /usr/lib/systemd/user/gpg-agent-browser.socket
lrwxrwxrwx 1 root root 44 Feb 10 02:17 gpg-agent-extra.socket -> /usr/lib/systemd/user/gpg-agent-extra.socket
lrwxrwxrwx 1 root root 38 Feb 10 02:17 gpg-agent.socket -> /usr/lib/systemd/user/gpg-agent.socket
lrwxrwxrwx 1 root root 42 Feb 10 02:17 gpg-agent-ssh.socket -> /usr/lib/systemd/user/gpg-agent-ssh.socket
lrwxrwxrwx 1 root root 43 Feb 10 21:42 pipewire-pulse.socket -> /usr/lib/systemd/user/pipewire-pulse.socket
root@cs03:/etc/systemd/user# rm sockets.target.wants/pipewire-pulse.socket
root@cs03:/etc/systemd/user#

Hopefully it is now actually back to a clean state ...

Cheers,
Diederik
signature.asc

Raphael Hertzog

unread,
Jun 10, 2022, 5:20:03 AM6/10/22
to
Hi,
I think we are not speaking of the same thing. The error message
refers to "/etc/systemd/user/pipewire-session-manager.service" and this
one is just a side-effect of the "Alias" directive.

The broken symlink that preserves the "enablement" state of the service
is /etc/systemd/user/pipewire.service.wants/pipewire-media-session.service
and this one doesn't get complained about.

To me it looks like that the symlinks created for the "alias" entries
should be removed when you remove the package if they point to the
alternative provided by the current package and it should be done
automatically by debhelper stuff. We should not have to tweak packages to
do that...

Or, probably better, the setup scripts should detect that the symlink for
the "alias" directive is currently broken and that it should take it over.
I filed this suggestion to systemd:
https://github.com/systemd/systemd/issues/23694

But in the mean time, it's certainly a good idea to manually clean it up
in pipewire-media-session preinst's "remove" to avoid this ugly error:

Paramétrage de wireplumber (0.4.10-2) ...
Failed to preset unit, file "/etc/systemd/user/pipewire-session-manager.service" already exists and is a
symlink to "/lib/systemd/user/pipewire-media-session.service".
/usr/bin/deb-systemd-helper: error: systemctl preset failed on wireplumber.service: No such file or directory

Cheers,
--
Raphaël Hertzog

Michael Biebl

unread,
Jun 10, 2022, 7:10:04 AM6/10/22
to

Am 10.06.22 um 11:00 schrieb Raphael Hertzog:

> To me it looks like that the symlinks created for the "alias" entries
> should be removed when you remove the package if they point to the
> alternative provided by the current package

I think this would break the
apt install foo; apt remove foo; apt install foo
case, as then you wouldn't have the symlink setup anymore.

It might be better to do this cleanup in the postinst of wireplumber
before the #DEBHELPER# stanza.
If it finds a dangling symlink which does *not* point to its own
service, then remove this dangling symlink before #DEBHELPER#, i.e.
before the dh_installsystemd bits.
OpenPGP_signature

Michael Biebl

unread,
Jun 10, 2022, 7:20:04 AM6/10/22
to
Am 10.06.22 um 13:07 schrieb Michael Biebl:
See also the related discussion in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741496

We have a similar issue for syslog.service and display-manager.service,
which are both a "shared" symlink between different alternatives.
OpenPGP_signature

Jeremy Bicha

unread,
Jun 17, 2022, 2:30:04 PM6/17/22
to
I have pushed a fix for this to Ubuntu 22.10 as discussed in
https://launchpad.net/bugs/1977564
It uses a postrm script provided by Dyaln to purge the systemd user
services. (Done in both wireplumber & pipewire-media-session).

After he posted the patch, Michael proposed a more complex maintainer
script. Michael, do you think that version is still needed?

Also, I tried installing wireplumber on Ubuntu 22.04 LTS without the
fix. Although the install gives a warning and the symlinks are broken,
sound still works even with pulseaudio uninstalled. Could someone help
me understand the impact of this bug? I think I want to fix it for
Ubuntu 22.04 LTS but understanding the impact would help for that.

I thought it was interesting that apt removing other systemd services
also results in broken symlinks unless `apt purge` is used. For
instance, uninstall wpasupplicant and there is a broken symlink
/etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service
Things seem to work ok like this, but is this the behavior we want?

Thank you,
Jeremy Bicha

Michael Biebl

unread,
Jun 17, 2022, 2:40:03 PM6/17/22
to

Am 17.06.22 um 20:18 schrieb Jeremy Bicha:
> I have pushed a fix for this to Ubuntu 22.10 as discussed in
> https://launchpad.net/bugs/1977564
> It uses a postrm script provided by Dyaln to purge the systemd user
> services. (Done in both wireplumber & pipewire-media-session).
>
> After he posted the patch, Michael proposed a more complex maintainer
> script. Michael, do you think that version is still needed?

I don't think what I proposed is more complex (on the contrary).

I also think the current approach of purging the state on remove is
incorrect as it doesn't preserve the state on a package reinstall.

Jeremy Bicha

unread,
Jun 17, 2022, 4:30:04 PM6/17/22
to
On Fri, Jun 17, 2022 at 2:31 PM Michael Biebl <bi...@debian.org> wrote:
> I don't think what I proposed is more complex (on the contrary).
>
> I also think the current approach of purging the state on remove is
> incorrect as it doesn't preserve the state on a package reinstall.

Would you like to submit a patch/merge proposal instead then?

Thank you,
Jeremy Bicha
0 new messages