[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Preference for build or debhelper installing systemd unit files?



Andreas Henriksson <andreas@fatal.se> writes:

> Hello J.T. Conklin,
>
> On Wed, Jan 11, 2017 at 09:49:43AM -0800, J.T. Conklin wrote:
>> This question is related to components Dell EMC (my current employer)
>> are contributing to the Linux Foundation's openswitch project.
>> 
>> With debhelper, systemd unit files can be installed by a package's build
>> (ie. the Makefile installs them in $DESTDIR/lib/systemd/system/...) or
>> they can be put in the debian/<package>.service and dh_systemd_* will
>> copy them to the package.  In both cases, the dh_systemd_* scripts
>> ensure that the proper boilerplate to enable/disable the service is
>> added to the package's {post,pre}{inst,rm} scriptlets.
>> 
>> My question, in the case where the same organization/people are
>> responsible for both the software and the debian packaging, is whether 
>> there is a preference of which method is used.
>
> Please do cooperate with your upstream on creating the best possible
> service files. For example sometimes it might be complicated to work out
> exactly which security restriction features you can turn on or not in a
> service file, hopefully with upstreams help you can work it out.
> Normally service files should not need to be distro specific.

Thanks Andreas,

Since Dell is contributing the content and the packaging, in effect we
are our own "upstream". While this gives us a lot of flexibility (some
would say "rope") to produce something that works, but not necessarily
doing the right thing. And since we own both halves, there is no excuse
not to follow best practices.

> This means prefer to *not* carry the service files in debian/*.service,
> because this directory is part of your debian delta (not upstream).
>
> At the same time it's not absolutely necessary for upstream to have
> Makefile code to install the files, sometimes they're just available in
> an example directory. In that case you can have them installed by just
> adding them to debian/foo.install
>
> Also, if there's some distro-specific thing you want to enable on top of
> the upstream provided service file you can handle that as a regular
> patch in debian/patches/foo.patch (which would be better than carrying
> your own copy in debian/foo.service which will sooner or later become
> outdated compared to upstreams).
>
> In general my recommendation is to always try to keep your debian/
> directory as minimal as possible. Everything you can and is useful to
> share with upstream you should try to push upstream.

These points are well taken, even if we're our own upstream.  Keeps
separation of concerns well defined.

Thanks again,

    --jtc


Reply to: