Your message dated Thu, 7 Nov 2024 11:32:27 +0100
with message-id <[email protected]>
and subject line Re: Bug#1083138: dh_installsystemd attempts to install unit 
file for wrong package
has caused the Debian Bug report #1083138,
regarding dh_installsystemd attempts to install unit file for wrong package
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1083138: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1083138
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: debhelper
Version: 13.20
Severity: important

Dear maintainers,

I'm doing packaging for a project that has multiple packages, each with one 
systemd unit file.
The dh_installsystemd debhelper picks up on the unit files and start processing 
them, but soon hits an error where it tries to process a unit file for package 
A that belongs to package B.

This is a debuild log snippet leading up to the error:

make[1]: Leaving directory '/home/dmark/salsa/netatalk'dh_installchangelogs 
-O--buildsystem=meson+ninja
dh_installman -O--buildsystem=meson+ninja
dh_installinit -O--buildsystem=meson+ninja
dh_installsystemd -O--buildsystem=meson+ninja
dh_installsystemd: error: Package 'a2boot' does not install unit 
'atalkd.service'.
make: *** [debian/rules:11: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -i -I failed

The corresponding debian/rules file looks like this:

https://salsa.debian.org/netatalk-team/netatalk/-/blob/debian/latest/debian/rules

As you can see, the upstream build system generates the unit files, which we 
then move into debian/ in an override in order for dh_installsystemd to pick 
them up.
The end result lineup of files is correct to my best understanding of 
dh_installsystemd.

A snippet from the top:

drwxr-xr-x  6 dmark dmark  4096 Oct  2 20:24 a2boot-rwxr-xr-x  1 dmark dmark  
1973 Oct  2 20:24 a2boot.init
-rw-r--r--  1 dmark dmark    16 Oct  1 22:49 a2boot.install
-rw-r--r--  1 dmark dmark    28 Oct  1 22:49 a2boot.manpages
-rw-r--r--  1 dmark dmark   363 Oct  2 20:24 a2boot.service
-rw-r--r--  1 dmark dmark   117 Oct  2 20:24 a2boot.substvars
drwxr-xr-x  6 dmark dmark  4096 Oct  2 20:24 atalkd
-rwxr-xr-x  1 dmark dmark  2153 Oct  2 20:24 atalkd.init
-rw-r--r--  1 dmark dmark   124 Oct  1 22:49 atalkd.install
-rw-r--r--  1 dmark dmark   109 Oct  1 22:49 atalkd.lintian-overrides
-rw-r--r--  1 dmark dmark   232 Oct  1 22:49 atalkd.manpages
-rw-r--r--  1 dmark dmark   429 Oct  2 20:24 atalkd.postrm.debhelper
-rw-r--r--  1 dmark dmark   669 Oct  2 20:24 atalkd.service
-rw-r--r--  1 dmark dmark   117 Oct  2 20:24 atalkd.substvars
[...]

Do you have any idea if we are making some kind of mistake in our setup, or if 
this is a bug in the debhelper script?

Right now we have a dirty workaround – 'dh_installsystemd || true' to ignore 
any error.
The resulting packages look correct!

Your support would be hugely appreciated.

Sincerely,
Daniel

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Daniel Markstedt:
[...]

Hi Niels,

This resolves the mystery, thank you. In this case, I am also the upstream maintainer of 
this project, so the easy solution is to remove "Also=" across the board from 
our systemd units.

We originally applied "Also=" as a convenience for users to make sure service X 
is always enabled when enabling service Y,Z etc. for when managing systemd services 
manually. But since we learned now that it gets interpreted differently downstream, I 
think retiring it the best course of action.

Thanks again!

Daniel

Hi Daniel

Thanks for getting back to me and letting me know you have resolved the issue. :) I will now close this bug (with this email).

If `Also=` becomes important for you again, I would recommend getting Luca involved. I am happy with changing the debhelper behavior with Luca's support, since I am using him as the domain expert here to cover for my short comings on this topic. :)

Best regards,
Niels

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to