Hello Артур Молчанов, On Tue, Dec 20, 2016 at 03:37:09PM +0300, Артур Молчанов wrote: > Hello, Andreas, > > Thanks for your reply. > > But I think that invoke-rc.d has strange behavior. Is it OK that it starts > disabled service? [...]
I discussed this bug report with the systemd / init-system-helpers maintainers on IRC and we went full-circle. This can indeed be seen as a bug, inside a workaround for another bug -> #830982. On the other hand adding a workaround in the workaround is ugly and *not* fixing it has the advantage that it catches actual packaging bugs. The conclusion was thus to not fix it but to leave this in the hands of the ipmiutil maintainer (who was also around and partially participating in the discussion). That the systemd services are disabled while the sysvinit side is, isn't the intended behaviour of ipmiutil as far as I can see. It's simply a packaging bug in ipmiutil that the services doesn't get enabled. (Also as noted before, the services are plain broken.) (The attached COMPLETELY UNTESTED patches should be a start for fixing up ipmiutil. HTH.) Regards, Andreas Henriksson
>From 6fc4caeb44b01159b8725d098255ce89a63689a5 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson <andr...@fatal.se> Date: Tue, 20 Dec 2016 13:33:29 +0100 Subject: [PATCH 1/3] Drop autoreconf/systemd, default for compat 10 Drop both dh-autoreconf/dh-systemd from both build-depends and dh --with arguments because this is all defaults when using dh compat 10.... Just a minor cleanup in other words. --- debian/control | 2 -- debian/rules | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/control b/debian/control index e64b1a9..597195f 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,6 @@ Maintainer: Jörg Frings-Fürst <deb...@jff-webhosting.net> Build-Depends: autotools-dev, debhelper (>= 10), - dh-autoreconf, - dh-systemd (>= 1.5), libfreeipmi-dev (>= 1.1.5) | libopenipmi-dev (>=2.0.18), libssl1.0-dev, libtool-bin diff --git a/debian/rules b/debian/rules index f123770..26b704c 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,7 @@ CFLAGS += -fPIC CONFPARA = --enable-gpl --enable-useflags --enable-libsensors %: - dh $@ --with autotools-dev --with systemd --with autoreconf + dh $@ --with autotools-dev override_dh_auto_configure: $(CURDIR)/beforeconf.sh -- 2.10.2
>From dc3a431bcc736d28089cdd230a9ce38ace74d549 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson <andr...@fatal.se> Date: Tue, 20 Dec 2016 13:45:43 +0100 Subject: [PATCH 2/3] Add debian/patches/0005-Fix-ipmi_port.service-syntax.patch The syntax in the service file shipped by upstream is broken. --- .../0005-Fix-ipmi_port.service-syntax.patch | 26 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 27 insertions(+) create mode 100644 debian/patches/0005-Fix-ipmi_port.service-syntax.patch diff --git a/debian/patches/0005-Fix-ipmi_port.service-syntax.patch b/debian/patches/0005-Fix-ipmi_port.service-syntax.patch new file mode 100644 index 0000000..70e65c0 --- /dev/null +++ b/debian/patches/0005-Fix-ipmi_port.service-syntax.patch @@ -0,0 +1,26 @@ +From: Andreas Henriksson <andr...@fatal.se> +Date: Tue, 20 Dec 2016 13:43:05 +0100 +Subject: Fix ipmi_port.service syntax + +systemd service files are not shell scripts. + +Break up the command is a pre- and start phase. +Use - to declare that exit code should be ignored. +--- + scripts/ipmi_port.service | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/scripts/ipmi_port.service b/scripts/ipmi_port.service +index a59128a..559a604 100644 +--- a/scripts/ipmi_port.service ++++ b/scripts/ipmi_port.service +@@ -6,7 +6,8 @@ After=network.target + Type=forking + PIDFile=/run/ipmi_port.pid + EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env +-ExecStart=/usr/share/ipmiutil/ipmiutil.setup >/dev/null && /usr/sbin/ipmi_port -b || : ++ExecStartPre=-/usr/share/ipmiutil/ipmiutil.setup ++ExecStart=-/usr/sbin/ipmi_port -b + + [Install] + WantedBy=multi-user.target diff --git a/debian/patches/series b/debian/patches/series index 3c0bdc5..75fdf43 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 0700-init.patch 0600-typo-man.patch 0705-crontab.patch +0005-Fix-ipmi_port.service-syntax.patch -- 2.10.2
>From ff51e2ae6b48071130eaa95617c1b0d8b85dccb8 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson <andr...@fatal.se> Date: Tue, 20 Dec 2016 13:51:39 +0100 Subject: [PATCH 3/3] Enable services, to match init scripts. debian/<package>.<servicename>.service is not automatically picked up by debhelper. Neither is debian/<package>.<initname>.init which is why a dh_installinit override using --name was added. A matching override is also needed for dh_systemd_enable though, or the state between sysvinit scripts and systemd native units will be shipped out of sync (and fail install). Also note the comment about dh_systemd_start which is an implementation detail (that might change in the future?). --- debian/rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/rules b/debian/rules index 26b704c..7c630dd 100755 --- a/debian/rules +++ b/debian/rules @@ -32,3 +32,13 @@ override_dh_installinit: dh_installinit --name=ipmiutil_asy dh_installinit --name=ipmiutil_evt dh_installinit --name=ipmiutil_wdt + +override_dh_systemd_enable: + dh_systemd_enable --name=ipmi_port + dh_systemd_enable --name=ipmi_info + dh_systemd_enable --name=ipmiutil_asy + dh_systemd_enable --name=ipmiutil_evt + dh_systemd_enable --name=ipmiutil_wdt + +# No need to also dh_systemd_start for all of these, as the resulting +# invoke-rc.d calls are already added by dh_installinit above. -- 2.10.2