dh_installsystemd and Also= directive

Daniele Nicolodi daniele at grinta.net
Mon Jun 11 07:36:59 BST 2018

On 11/06/2018 00:26, Niels Thykier wrote:
> Daniele Nicolodi:
>> dh_installsystemd needs to resolve Also= directives in service files to
>> emit postrm blocks to disable all unit enabled at installation time. The
>> code seems to try to support unit files that have Also= directives
>> pointing to units defined in other packages, however, if one of those is
>> encountered dh_installsystemd fails a bit later when it tries to read
>> the unit file specified in the Also= directive and does not find it.
> Ack, note that the "late failure" is deliberate to present as many
> issues to the user as possible (to keep the amount of "rinse and
> repeat"-testing to a minimum).

A bit later is a few lines of code below, in the same iteration. I don't
see how that may be helpful.

>> Because of this failure, I believe that no one relays on this
>> functionality. I also don't think it is a good practice to have an unit
>> have an Also= directive pointing to a unit defined in another package,
>> it seems a recipe for unexpected results.
> I do not think it was ever intended to support units from other
> packages.  And I agree, it looks like a recipe for disaster.

The emitted warning seems to suggest that Also= pointing to units in
other packages was considered a possibility. I'm happy to read otherwise.

>> Should this use case be supported?  Or should the half baked support be
>> removed and error handling in dh_installsystemd improved a bit?
> I think this is mostly a question of documentation changes and possible
> a tweak of the error message?

Which error message?  Right now dh_installsystemd fails complaining it
cannot open a file for reading.


More information about the Pkg-systemd-maintainers mailing list