dh_installsystemd command line arguments handling

Niels Thykier niels at thykier.net
Mon Jun 11 22:07:00 BST 2018


Daniele Nicolodi:
> Hello,
> 
> please keep me in Cc, I'm not subscribed to the list.
> 
> [...]
> 

Hi, :)

I am reducing the mail a bit because I think this discussion is based on
the following question.  (Note quotes reordered for "standalone"
readability in this reduced form)


>
> Which of those formats is supposed to be supported?
>

> 1. [...]
>
>   dh_installsystemd debian/foo.service
> 
> [...]
> 
> 2. [...]
> 
>   dh_installsystemd foo.service
> 
> [...]
> 
> 3. [...]
> 
>   dh_installsystemd -p foo foo.service
> 
> [...]


To answer these we need to answer the following question: As a user of
dh_installsystemd, when would I want to spell out a service to
dh_installsystemd as an explicit argument?  What would I be trying to
solve in this case?
  By default dh_installsystemd will install all unit files and setup
maintscript snippets for all of them (which is the common case).


Options include (but probably not limited too):

 A: Have dh_installsystemd install a unit file provided in a non-default
    location.  E.g. assuming upstream provides it but the build system
    do not install it into the tmpdir.

 B: To be able to select a subset of the units and choose a non-default
    maintscript for them.  E.g.  --no-start --no-enable foo.service
    followed by "--no-restart-after-upgrade bar.service" (in a separate
    dh_installsystemd invocation).

 C: Your suggestion/interpretation here...



AFAICT/AFAIR, the code wants to solve B (but let me know if you have a
different interpretation/suggestion).

In the interpretation, a call to "dh_installsystemd [--option]
foo.service" could make sense[1] even if the helper acted on multiple
binaries (as a "generate only maintscripts for foo.service subject to
--option").
  Though at the same time, in that interpretation "foo.service" is
definitely sufficient to reference the unit file as we must always
reference an "installed" unit file (as you mentioned yourself).

But anyhow, this assumes we agree that B is the best answer to the "what
is the user trying to do with dh_installsystemd".

Thanks,
~Niels

[1] Make sense != actually works != best choice != trivial to code.





More information about the Pkg-systemd-maintainers mailing list