Skip to content

Commit 2e3c544

Browse files
dtardonharaldh
authored andcommitted
fix(multipath): get config. dir from configuration
1 parent 6a44426 commit 2e3c544

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

modules.d/90multipath/module-setup.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ installkernel() {
6363
# called by dracut
6464
install() {
6565
local -A _allow
66+
local config_dir
6667

6768
add_hostonly_mpath_conf() {
6869
if is_mpath "$1"; then
@@ -74,6 +75,16 @@ install() {
7475
fi
7576
}
7677

78+
local k v
79+
while read -r k v; do
80+
if [[ $k == "config_dir" ]]; then
81+
v="${v#\"}"
82+
config_dir="${v%\"}"
83+
break
84+
fi
85+
done < <(multipath -t 2> /dev/null)
86+
[[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d
87+
7788
inst_multiple \
7889
pkill \
7990
pidof \
@@ -91,7 +102,7 @@ install() {
91102
/etc/xdrdevices.conf \
92103
/etc/multipath.conf \
93104
/etc/multipath/* \
94-
/etc/multipath/conf.d/*
105+
"$config_dir"/*
95106

96107
[[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
97108
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf

0 commit comments

Comments
 (0)