Hi,
I'm packaging a logging service for buster. Users typically only need to
run one instance but power users might want to run multiple instances.
This sounds like a perfect use case for systemd templates [1] to me.
However, I'm struggling to get my package to install + enable + start a
default instance ([email protected]) of a service template
([email protected]).

I started by naïvely providing debian/[email protected] as part of
my package. Unfortunately, this file only gets installed but neither
enabled nor started. I can manually do so after installing the package
by running

systemctl enable [email protected] *
systemctl start [email protected]

*This works since I have specified "DefaultInstance=default" in the
template's "[Install]" section.

I tried to encourage dh_systemd_enable to enable my template automatically:

override_dh_systemd_enable:
       dh_systemd_enable [email protected]

Apparently dh_systemd_enable ignores templates, though. So I tried
specifying an instance

override_dh_systemd_enable:
       dh_systemd_enable [email protected]

This fails ('dh_systemd_enable: Requested unit
"[email protected]" but it was not found in any package acted
on.').

I tried to provide [email protected] explicitly which fixed
the error above. Still no luck, though: dh_systemd_enable doesn't
install this file so I had to add it to ioclogserver.install. That takes
care of the installation part but it's still not being considered by
dh_systemd_enable...

It seems like I'm not the first one running into this limitation of
debhelper [2]. I'm wondering if there's a way I can work around this
until [2] has been addressed. Or am I trying to accomplish something
that I'm not supposed to do in the first place?

Thanks,

Martin

[1]
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Service%20Templates
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889635

Reply via email to