Skip to content

Commit

Permalink
multipath-tools: add compile time configuration for "/etc/multipath"
Browse files Browse the repository at this point in the history
Instead of hard-conding "/etc/multipath" as the path for the state
files "bindings", "prkeys", and "wwids", make this path configurable
via the "statedir" compile-time option. The default is currently still
/etc, it might change to /var/lib or similar in the future.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
  • Loading branch information
mwilck committed Sep 15, 2023
1 parent 98236a2 commit 6d0f917
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pkgconfdir := $(usrlibdir)/pkgconfig
plugindir := $(prefix)/$(LIB)/multipath
configdir := $(etc_prefix)/etc/multipath/conf.d
configfile := $(etc_prefix)/etc/multipath.conf
statedir := $(etc_prefix)/etc/multipath
runtimedir := $(if $(shell test -L /var/run -o ! -d /var/run && echo 1),/run,/var/run)
devmapper_incdir := $(or $(shell $(PKG_CONFIG) --variable=includedir devmapper),/usr/include)
libudev_incdir := $(or $(shell $(PKG_CONFIG) --variable=includedir libudev),/usr/include)
Expand Down Expand Up @@ -88,7 +89,8 @@ WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implici
CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) \
-DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(plugindir)\" \
-DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(configdir)\" \
-DDEFAULT_CONFIGFILE=\"$(configfile)\" -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
-DDEFAULT_CONFIGFILE=\"$(configfile)\" -DSTATE_DIR=\"$(statedir)\" \
-DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
CFLAGS := --std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
BIN_CFLAGS := -fPIE -DPIE
LIB_CFLAGS := -fPIC
Expand Down
6 changes: 3 additions & 3 deletions libmultipath/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
#define MAX_DEV_LOSS_TMO UINT_MAX
#define DEFAULT_PIDFILE RUNTIME_DIR "/multipathd.pid"
#define DEFAULT_SOCKET "/org/kernel/linux/storage/multipathd"
#define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings"
#define DEFAULT_WWIDS_FILE "/etc/multipath/wwids"
#define DEFAULT_PRKEYS_FILE "/etc/multipath/prkeys"
#define DEFAULT_BINDINGS_FILE STATE_DIR "/bindings"
#define DEFAULT_WWIDS_FILE STATE_DIR "/wwids"
#define DEFAULT_PRKEYS_FILE STATE_DIR "/prkeys"
#define MULTIPATH_SHM_BASE RUNTIME_DIR "/multipath/"


Expand Down

0 comments on commit 6d0f917

Please sign in to comment.