fix(multipath): check if mpathconf is available
Not all distributions utilize and ship the mpathconf utilitiy. Avoid error messages and systemd complaints about multipathd-configure.service in this case.master
parent
6246da400f
commit
4318533e14
|
@ -60,6 +60,10 @@ installkernel() {
|
||||||
hostonly='' dracut_instmods -o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
|
hostonly='' dracut_instmods -o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mpathconf_installed() {
|
||||||
|
command -v mpathconf &> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
install() {
|
install() {
|
||||||
local -A _allow
|
local -A _allow
|
||||||
|
@ -104,7 +108,8 @@ install() {
|
||||||
/etc/multipath/* \
|
/etc/multipath/* \
|
||||||
"$config_dir"/*
|
"$config_dir"/*
|
||||||
|
|
||||||
[[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
|
mpathconf_installed \
|
||||||
|
&& [[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
|
||||||
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
|
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
|
||||||
if ((${#_allow[@]} > 0)); then
|
if ((${#_allow[@]} > 0)); then
|
||||||
local -a _args
|
local -a _args
|
||||||
|
@ -128,9 +133,11 @@ install() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if dracut_module_included "systemd"; then
|
if dracut_module_included "systemd"; then
|
||||||
inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service"
|
if mpathconf_installed; then
|
||||||
|
inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service"
|
||||||
|
$SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service
|
||||||
|
fi
|
||||||
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
|
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
|
||||||
$SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service
|
|
||||||
$SYSTEMCTL -q --root "$initdir" enable multipathd.service
|
$SYSTEMCTL -q --root "$initdir" enable multipathd.service
|
||||||
else
|
else
|
||||||
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
||||||
|
|
Loading…
Reference in New Issue