#984897 Problems in a setup with two conflicting binary packages which share the same service name

Package:
debhelper
Source:
debhelper
Submitter:
Santiago Garcia Mantinan
Date:
2022-03-27 11:39:03 UTC
Severity:
normal
Tags:
#984897#5
Date:
2021-03-09 23:57:05 UTC
From:
To:
Recently we decided to ship two binary versions of squid, one compiled with
gnutls and the other with openssl, as the code provides different features
depending with what is compiled.

I decided to produce two binary packages conflicting with each other, squid
and squid-openssl but that provide the same service squid.service

The problem comes when we purge one that is removed when the other is
installed, I see the problem on the automatic added sections of the postrm
script.

I have filled a bug on squid explaining the problem (#984880) and tried to
explain this here:

https://lists.debian.org/debian-mentors/2021/03/msg00022.html

The problem is with both dh_installinit and dh_installsystemd, I have
prepared a patch based on the dh_apparmor's code which does have checks for
this.

I don't know debhelper's code, and even tough this patch works ok for me,
the plural of #UNITFILES# makes me think that it can have several files on
it wich would make my patch fail on this case, I hope the patch gives you
the idea of what would be needed.

Fixing this bug would be needed to fix bug #984880 on squid for Bullseye, I
don't know if it is possible to have a fix for this on debhelper or if we
should try to woraround this on squid's postrm script, I hope that you can
have a look at this and let me know.

Regards.

#984897#10
Date:
2022-02-04 14:58:33 UTC
From:
To:
Hi!

We had spoken about this problem and the possible fix and by that time, so
close to Bullseye release... it was not a good timing.

I guess now would be the right timing, before bookworm gets us again in a
bad timing situation again.

Do you need any more info on this?

Regards.

#984897#15
Date:
2022-03-23 20:30:57 UTC
From:
To:
Hi!

This bug came in response for a proper fix in order for the problem we found
in squid after introducing the new squid-openssl flavour, that was:
https://bugs.debian.org/984880

At that time I spoke to Niels Thykier in order to fix this, but it was late
in the bullseye development cycle a fix on debhelper seemed too dangerous,
I've further thought about the problem, as the first patch I had sent was
failing when dh_installsystemd was called with several services, like:

dh_installsystemd -ppackage first.service second.service

The new proposal takes this into account and now UNITFILES can really be
plural, in the sense of have mor than one unit file, and thus I believe this
is finally a full solution.

Please consider this merge request:
https://salsa.debian.org/debian/debhelper/-/merge_requests/65
so that we can have a proper fix for #984880 on squid in time for bookworm
and if you need further explanations just let me know.

Regards.

#984897#20
Date:
2022-03-27 11:19:59 UTC
From:
To:
Santiago Garcia Mantinan:

Hi Santiago,

Thanks for the MR.

@fsateler/@biebl: Please have a look at
https://salsa.debian.org/debian/debhelper/-/merge_requests/65/diffs -
would it make sense to move this check into deb-systemd-helper ?   I
feel the snippet is getting a bit to complex with this.

Thanks,
~Niels