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

2021-10-25 Thread Chris Halls
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



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

2021-10-25 Thread Dylan Aïssi
Hi Chris,

Thanks for your report!

Le lun. 25 oct. 2021 à 12:30, Chris Halls  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



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

2021-10-29 Thread Laurent Bigonville
On Mon, 25 Oct 2021 15:44:31 +0200 =?UTF-8?B?RHlsYW4gQcOvc3Np?= 
 wrote:

> Hi Chris,
>
> Thanks for your report!
>
> Le lun. 25 oct. 2021 à 12:30, Chris Halls  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.




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

2022-06-10 Thread Raphael Hertzog
Hi,

On Sat, 30 Oct 2021 01:37:53 +0200 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".
> Only if you purge a package, its conffiles are removed (and its systemd 
> enablement state)
> 
> Are you saying this is not the correct way?

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



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

2021-10-29 Thread Michael Biebl



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?



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

2021-10-30 Thread Michael Biebl

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
Description: OpenPGP digital signature


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

2021-10-30 Thread Laurent Bigonville

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".
Only if you purge a package, its conffiles are removed (and its 
systemd enablement state)


Are you saying this is not the correct way?


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?




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

2022-06-10 Thread Michael Biebl


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
Description: OpenPGP digital signature


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

2022-06-10 Thread Michael Biebl

Am 10.06.22 um 13:07 schrieb Michael Biebl:


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.


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
Description: OpenPGP digital signature


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

2022-06-17 Thread 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?

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



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

2022-06-17 Thread Michael Biebl



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.




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

2022-06-17 Thread Jeremy Bicha
On Fri, Jun 17, 2022 at 2:31 PM Michael Biebl  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