I am quite a newbie myself so don't think I be able to propose something rock solid.
This problem is quite trivial.
Normally dh_systemd_enable expect to see *.service file inside debian/ directory or installed into /lib/systemd/system/ of created package. And in case of tarantool package it installing tarantool.service into file tree with dh_install which called after dh_systemd_enable. Same situation was before #715504 bug closed in cdbs 0.4.123 (Fix debhelper snippet to call dh_systemd_* after dh_install.). But with #811555 bug there was a need to put dh_systemd_enable before dh_installinit. And this was resolved by moving dh_systemd_enable up before dh_installinit (and before dh_install). After #811555 bug resolution #715504 bug become valid again.

As result we get such kind of error:
dh_systemd_enable -ptarantool-common --name=tarantool tarantool.service
dh_systemd_enable: Could not find "tarantool.service" in the /lib/systemd/system directory of tarantool-common. This could be a typo, or using Also= with a service file from another package. Please check carefully that this message is harmless. dh_systemd_enable: Cannot open(tarantool.service) for extracting the Also= line(s)


In result this service are not automatically started after installation (not a big deal actually).

I've attached file with solution working for current tarantool package. But I quite unsure if such order of execution not breaking something else. Maybe dh_install should be moved higher instead of my solution to put dh_systemd_enable and dh_installinit lower.
I am only hope someone more experienced will take a lead here.
Probably this bug should be addressed inside tarantool package.

And as I've checked miredo package it doesn't have such problem probably because they doesn't using cdbs currently.


On 06/09/2017 03:16 PM, Jonas Smedegaard wrote:
Quoting Alexander Sbitnev (2017-06-09 13:02:32)
During resolution of bug #811555 dh_systemd_enable was moved up to be
before dh_installinit. But probably instead dh_installinit (and now
dh_systemd_enable) should be moved down to be after dh_install.
Atleast tarantool package unable to produce pure systemd startup files
as result of this bug. Current situation is compensated by legacy SysV
init startup files but not on pure systemd setup. Probably mentioned
in #715504 miredo package is also have same problem.
Thanks for reporting.

I am no expert in systemd.

Please (you or someone else more knowledgeable than me) provide a patch
- or at least a clear description of a single order of execution of all
involved parts - which takes these multiple bugreports into account.

  - Jonas


>From 0534f8384784e7a4660dcae5cf51941325f2c623 Mon Sep 17 00:00:00 2001
From: Alexander Sbitnev <[email protected]>
Date: Fri, 9 Jun 2017 19:50:20 +0300
Subject: [PATCH] Run dh_systemd_enable after dh_install

---
 1/rules/debhelper.mk.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/1/rules/debhelper.mk.in b/1/rules/debhelper.mk.in
index f4fde04..b4bb135 100644
--- a/1/rules/debhelper.mk.in
+++ b/1/rules/debhelper.mk.in
@@ -234,12 +234,6 @@ $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)):: binary-install/%:
 	dh_installinfo -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_INSTALL_INFO)
 	dh_installmenu -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_DH_INSTALL_MENU_ARGS)
 	dh_installcron -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_DH_INSTALL_CRON_ARGS)
-	$(if $(wildcard /usr/bin/dh_systemd_enable),\
-		dh_systemd_enable -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_DH_SYSTEMD_ENABLE_ARGS))
-	dh_installinit -p$(cdbs_curpkg) $(strip \
-		$(if $(call cdbs_expand_curvar,DEB_UPDATE_RCD_PARAMS),\
-			--update-rcd-params="$(call cdbs_strip_quotes,$(call cdbs_expand_curvar,DEB_UPDATE_RCD_PARAMS))") \
-			$(call cdbs_expand_curvar,DEB_DH_INSTALLINIT_ARGS))
 	dh_installdebconf -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_DH_INSTALLDEBCONF_ARGS)
 	dh_installemacsen -p$(cdbs_curpkg) $(strip \
 		$(if $(DEB_EMACS_PRIORITY),\
@@ -264,6 +258,12 @@ $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)):: binary-install/%:
 		$(if $(DEB_DH_INSTALL_SOURCEDIR),\
 			--sourcedir=$(DEB_DH_INSTALL_SOURCEDIR)) \
 		$(call cdbs_expand_curvar,DEB_DH_INSTALL_ARGS))
+	$(if $(wildcard /usr/bin/dh_systemd_enable),\
+		dh_systemd_enable -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_DH_SYSTEMD_ENABLE_ARGS))
+	dh_installinit -p$(cdbs_curpkg) $(strip \
+		$(if $(call cdbs_expand_curvar,DEB_UPDATE_RCD_PARAMS),\
+			--update-rcd-params="$(call cdbs_strip_quotes,$(call cdbs_expand_curvar,DEB_UPDATE_RCD_PARAMS))") \
+			$(call cdbs_expand_curvar,DEB_DH_INSTALLINIT_ARGS))
 	$(if $(wildcard /usr/bin/dh_systemd_start),\
 		dh_systemd_start -p$(cdbs_curpkg) $(call cdbs_expand_curvar,DEB_DH_SYSTEMD_START_ARGS))
 # TODO: Use DEB_DH_LINK_ARGS as package-default var (not global addon)
-- 
2.7.4

Reply via email to