All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: mwilck@suse.com
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	dm-devel@lists.linux.dev
Subject: Re: [PATCH v2 08/14] multipathd.service: require modprobe@dm_multipath.service if available
Date: Fri, 27 Oct 2023 15:09:57 -0400	[thread overview]
Message-ID: <ZTwLBRUJwTPaEIS3@bmarzins-01.fast.rdu2.eng.redhat.com> (raw)
In-Reply-To: <20231026174153.1133-9-mwilck@suse.com>

On Thu, Oct 26, 2023 at 07:41:47PM +0200, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> systemd v245 and newer provides the modprobe@.service unit, which
> can be used to pull in modules via systemd. This is cleaner than
> loading dm-multipath unconditionally via modules-load.d. Use it
> if the detected systemd version support it.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  Makefile.inc                                             | 4 +++-
>  multipath/Makefile                                       | 6 ++++--
>  multipathd/Makefile                                      | 4 ++--
>  multipathd/{multipathd.service => multipathd.service.in} | 4 ++--
>  4 files changed, 11 insertions(+), 7 deletions(-)
>  rename multipathd/{multipathd.service => multipathd.service.in} (85%)
> 
> diff --git a/Makefile.inc b/Makefile.inc
> index 04bfa56..8655cba 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -90,6 +90,8 @@ ORIG_LDFLAGS     := $(LDFLAGS)
>  
>  SYSTEMD_CPPFLAGS := $(if $(SYSTEMD),-DUSE_SYSTEMD=$(SYSTEMD))
>  SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo 1),-lsystemd,-lsystemd-daemon))
> +MODPROBE_UNIT := $(shell test "0$(SYSTEMD)" -lt 245 2>/dev/null || \
> +			echo "modprobe@dm_multipath.service")
>  
>  OPTFLAGS	:= -O2 -g $(STACKPROT) --param=ssp-buffer-size=4
>  WARNFLAGS	:= -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implicit-int \
> @@ -144,4 +146,4 @@ NV_VERSION_SCRIPT = $(DEVLIB:%.so=%-nv.version)
>  
>  %:	%.in
>  	@echo creating $@
> -	$(Q)sed 's:@CONFIGFILE@:'$(configfile)':g;s:@CONFIGDIR@:'$(configdir)':g;s:@STATE_DIR@:'$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g' $< >$@
> +	$(Q)sed 's:@CONFIGFILE@:'$(configfile)':g;s:@CONFIGDIR@:'$(configdir)':g;s:@STATE_DIR@:'$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g' $< >$@
> diff --git a/multipath/Makefile b/multipath/Makefile
> index 68cb5ce..0efb9b2 100644
> --- a/multipath/Makefile
> +++ b/multipath/Makefile
> @@ -27,14 +27,16 @@ install:
>  	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(udevrulesdir)
>  	$(Q)$(INSTALL_PROGRAM) -m 644 11-dm-mpath.rules $(DESTDIR)$(udevrulesdir)
>  	$(Q)$(INSTALL_PROGRAM) -m 644 multipath.rules $(DESTDIR)$(udevrulesdir)/56-multipath.rules
> -	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir)
> -	$(Q)$(INSTALL_PROGRAM) -m 644 modules-load.conf $(DESTDIR)$(modulesloaddir)/multipath.conf
>  	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(tmpfilesdir)
>  	$(Q)$(INSTALL_PROGRAM) -m 644 tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/multipath.conf
>  	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)/man8
>  	$(Q)$(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)/man8
>  	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)/man5
>  	$(Q)$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5 $(DESTDIR)$(mandir)/man5
> +	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(modulesloaddir)
> +ifeq ($(MODPROBE_UNIT),)
> +	$(Q)$(INSTALL_PROGRAM) -m 644 modules-load.conf $(DESTDIR)$(modulesloaddir)/multipath.conf
> +endif
>  ifneq ($(SCSI_DH_MODULES_PRELOAD),)
>  	$(Q)$(INSTALL_PROGRAM) -m 644 scsi_dh.conf $(DESTDIR)$(modulesloaddir)/scsi_dh.conf
>  	$(Q)for _x in $(SCSI_DH_MODULES_PRELOAD); do echo "$$_x"; done \
> diff --git a/multipathd/Makefile b/multipathd/Makefile
> index 0ba6ecb..997b40c 100644
> --- a/multipathd/Makefile
> +++ b/multipathd/Makefile
> @@ -41,7 +41,7 @@ ifeq ($(FPIN_SUPPORT),1)
>  OBJS += fpin_handlers.o
>  endif
>  
> -all : $(EXEC) $(CLI) $(MANPAGES)
> +all : $(EXEC) $(CLI) $(MANPAGES) $(EXEC).service
>  
>  $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so
>  	@echo building $@ because of $?
> @@ -78,7 +78,7 @@ uninstall:
>  	$(Q)$(RM) $(DESTDIR)$(unitdir)/$(EXEC).socket
>  
>  clean: dep_clean
> -	$(Q)$(RM) core *.o $(EXEC) $(CLI) $(MANPAGES)
> +	$(Q)$(RM) core *.o $(EXEC) $(CLI) $(MANPAGES) $(EXEC).service
>  
>  include $(wildcard $(OBJS:.o=.d) $(CLI_OBJS:.o=.d))
>  
> diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service.in
> similarity index 85%
> rename from multipathd/multipathd.service
> rename to multipathd/multipathd.service.in
> index 5a9cde1..6d03ff7 100644
> --- a/multipathd/multipathd.service
> +++ b/multipathd/multipathd.service.in
> @@ -2,8 +2,8 @@
>  Description=Device-Mapper Multipath Device Controller
>  Before=lvm2-activation-early.service
>  Before=local-fs-pre.target blk-availability.service shutdown.target
> -Wants=systemd-udevd-kernel.socket
> -After=systemd-udevd-kernel.socket
> +Wants=systemd-udevd-kernel.socket @MODPROBE_UNIT@
> +After=systemd-udevd-kernel.socket @MODPROBE_UNIT@
>  After=multipathd.socket systemd-remount-fs.service
>  Before=initrd-cleanup.service
>  DefaultDependencies=no
> -- 
> 2.42.0


  reply	other threads:[~2023-10-27 19:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 17:41 [PATCH v2 00/14] multipath: aio, systemd, and documentation improvements mwilck
2023-10-26 17:41 ` [PATCH v2 01/14] libmultipath: reduce log level of directio messages mwilck
2023-10-26 17:41 ` [PATCH v2 02/14] libmultipath: directio: don't reset ct->running after io_cancel() mwilck
2023-10-27 18:54   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 03/14] libmultipath: directio: fix error handling mwilck
2023-10-27 18:54   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 04/14] libmultipath: io_err_stat: don't free aio memory before completion mwilck
2023-10-27 18:55   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 05/14] libmultipath: io_err_stat: call io_destroy() inside free_io_err_pathvec() mwilck
2023-10-27 18:55   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 06/14] libmultipath: io_err_stat: use higher number of aio slots mwilck
2023-10-27 18:56   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 07/14] libmultipath: io_err_stat: fix error handling mwilck
2023-10-27 19:09   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 08/14] multipathd.service: require modprobe@dm_multipath.service if available mwilck
2023-10-27 19:09   ` Benjamin Marzinski [this message]
2023-10-27 20:05   ` Benjamin Marzinski
2023-10-30 11:45     ` Martin Wilck
2023-10-26 17:41 ` [PATCH v2 09/14] libmpathutil: remove systemd_service_enabled() mwilck
2023-10-26 17:41 ` [PATCH v2 10/14] multipath.conf.5: fix typo mwilck
2023-10-27 19:10   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 11/14] Makefile.inc, README.md: fix docs for prefix in split-usr case mwilck
2023-10-27 19:27   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 12/14] README.md: update mailing list and contributing information mwilck
2023-10-27 19:29   ` Benjamin Marzinski
2023-10-30 11:41     ` Martin Wilck
2023-10-26 17:41 ` [PATCH v2 13/14] README.md: Extend the section about NVMe mwilck
2023-10-27 19:34   ` Benjamin Marzinski
2023-10-26 17:41 ` [PATCH v2 14/14] README.md: fix formatting of Changelog section mwilck
2023-10-27 19:35   ` Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZTwLBRUJwTPaEIS3@bmarzins-01.fast.rdu2.eng.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=mwilck@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.