diff mbox series

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

Message ID alpine.DEB.2.22.394.2202181525440.239973@ubuntu-linux-20-04-desktop (mailing list archive)
State New, archived
Headers show
Series tools/hotplug: don't install init.d scripts if SYSTEMD | expand

Commit Message

Stefano Stabellini Feb. 18, 2022, 11:30 p.m. UTC
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>

Comments

Andrew Cooper Feb. 18, 2022, 11:40 p.m. UTC | #1
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
diff mbox series

Patch

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: