dh_installsystemd and Also= directive
niels at thykier.net
Mon Jun 11 07:26:00 BST 2018
> please keep me in Cc, I'm not subscribed to the list.
> I'm implementing user units support in dh_installsystemd. For doing so
> the code needs a bit of refactoring and thus I'm trying to understand
> how the tool is supposed to operate and adding some tests to check that
> nothing will break in the process.
> 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).
> 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.
> Should this use case be supported? Or should the half baked support be
> removed and error handling in dh_installsystemd improved a bit?
> Thanks. Cheers,
I think this is mostly a question of documentation changes and possible
a tweak of the error message?
More information about the Pkg-systemd-maintainers