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.

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. Having a good
dialog with you upstream is useful in many cases. Even if you currently
can work out what you need sooner or later you'll likely run into an
issue which is easier to work out with upstreams help.

Regards,
Andreas Henriksson

Reply via email to