[PATCH] tools/hotplug: don't install init.d scripts if SYSTEMD

Stefano Stabellini posted 1 patch 2 years, 2 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/alpine.DEB.2.22.394.2202181525440.239973@ubuntu-linux-20-04-desktop
[PATCH] tools/hotplug: don't install init.d scripts if SYSTEMD
Posted by Stefano Stabellini 2 years, 2 months ago
When Xen is configured with --with-systemd currently both the systemd
init scripts as well as the traditional init.d scripts (e.g. xencommons)
are installed.

This causes issues to distros where old style init scripts are still
supported even when systemd is enabled, e.g. Yocto. The consequence is
that xenconsoled (and other daemons) are executed twice resulting in
errors at boot.

If --with-systemd don't install xencommons and the other sysvinit
scripts.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>


diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0b1d111d7e..03ed00ca70 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -47,10 +47,12 @@ install-initd:
 	$(INSTALL_DATA) init.d/sysconfig.xendomains $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
 	$(INSTALL_DATA) init.d/sysconfig.xencommons $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
 	$(INSTALL_PROG) xendomains $(DESTDIR)$(LIBEXEC_BIN)
+ifndef CONFIG_SYSTEMD
 	$(INSTALL_PROG) init.d/xendomains $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) init.d/xencommons $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) init.d/xendriverdomain $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
+endif
 
 .PHONY: uninstall-initd
 uninstall-initd:

Re: [PATCH] tools/hotplug: don't install init.d scripts if SYSTEMD
Posted by Andrew Cooper 2 years, 2 months ago
On 18/02/2022 23:30, Stefano Stabellini wrote:
> When Xen is configured with --with-systemd currently both the systemd
> init scripts as well as the traditional init.d scripts (e.g. xencommons)
> are installed.
>
> This causes issues to distros where old style init scripts are still
> supported even when systemd is enabled, e.g. Yocto. The consequence is
> that xenconsoled (and other daemons) are executed twice resulting in
> errors at boot.
>
> If --with-systemd don't install xencommons and the other sysvinit
> scripts.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>

I agree with the intent, but just because you want the systemd files
doesn't mean you don't want the sysvinit files.  (Also, I've been trying
to persuade Alpine or Gentoo to upstream the OpenRC config files too,
which would make a 3rd).

There wants to be --with-sysvinit (defaulting to y) to controlling this,
at which point a packager can chose any/all initsystems worth of config.

~Andrew