dh_installinit
looks for debian/$(package).service
, but a package may provide multiple services.
Is it possible for one to bundle multiples .service
for one package with this method?
You can call dh_installinit
multiple times with different --name
parameters to install multiple services:
override_dh_installinit:
dh_installinit --name=service1
dh_installinit --name=service2
(or similar approaches if you're not using short dh
style). If your source package builds multiple binary packages, you can add -p
options to limit dh_installinit
's action to the appropriate package.
Starting from compatibility level 11, dh_installinit
no longer handles systemd services. Use dh_installsystemd
instead:
override_dh_installsystemd:
dh_installsystemd --name=service1
dh_installsystemd --name=service2
(The above assumes that you have two service files: debian/<package-name>.service1.service
and debian/<package-name>.service2.service
.)
debian/compat
(or dependency in debian/control
) must be at least 12 otherwise the override_dh_installsystemd
is ignored.
– Alexis Wilke
Aug 12 '23 at 15:47
--name
option only mentions.upstart
,.init
&.default
file types. --- Install the init script (and default file) as well as upstart job file using the filename name instead of the default filename, which is the package name. When this parameter is used, dh_installinit looks for and installs files named debian/package.name.init, debian/package.name.default and debian/package.name.upstart instead of the usual debian/package.init, debian/package.default and debian/package.upstart. – Wimateeka Feb 07 '18 at 18:50--name
is handled globally for alldebhelper
commands, byDebian::Debhelper::Dh_Getopt
,::Dh_Lib
and::Buildsystem
; it works for all supported file types. See for examplecups
andglibc
which both usedh_installinit
with a--name
argument to install systemd services. – Stephen Kitt Feb 07 '18 at 21:24