Skip to content

Commit

Permalink
fix(multipath): get config. dir from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dtardon authored and haraldh committed Jun 28, 2021
1 parent 6a44426 commit 2e3c544
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules.d/90multipath/module-setup.sh
Expand Up @@ -63,6 +63,7 @@ installkernel() {
# called by dracut
install() {
local -A _allow
local config_dir

add_hostonly_mpath_conf() {
if is_mpath "$1"; then
Expand All @@ -74,6 +75,16 @@ install() {
fi
}

local k v
while read -r k v; do
if [[ $k == "config_dir" ]]; then
v="${v#\"}"
config_dir="${v%\"}"
break
fi
done < <(multipath -t 2> /dev/null)
[[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d

inst_multiple \
pkill \
pidof \
Expand All @@ -91,7 +102,7 @@ install() {
/etc/xdrdevices.conf \
/etc/multipath.conf \
/etc/multipath/* \
/etc/multipath/conf.d/*
"$config_dir"/*

[[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
Expand Down

0 comments on commit 2e3c544

Please sign in to comment.