Add support for "multipath=off" and "nompath" on kernel cmdline
authorMartin Wilck <mwilck@suse.de>
Tue, 28 Feb 2017 16:22:59 +0000 (17:22 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 16 Mar 2017 06:52:58 +0000 (07:52 +0100)
Add support for disabling multipathd startup from the kernel command line.
This is useful for debugging purposes.

Signed-off-by: Martin Wilck <mwilck@suse.com>
multipath/multipath.rules
multipathd/multipathd.service

index c8fb7e6..86defc0 100644 (file)
@@ -3,6 +3,11 @@ SUBSYSTEM!="block", GOTO="end_mpath"
 ACTION!="add|change", GOTO="end_mpath"
 KERNEL!="sd*|dasd*", GOTO="end_mpath"
 
+IMPORT{cmdline}="nompath"
+ENV{nompath}=="?*", GOTO="end_mpath"
+IMPORT{cmdline}="multipath"
+ENV{multipath}=="off", GOTO="end_mpath"
+
 ENV{DEVTYPE}!="partition", GOTO="test_dev"
 IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH"
 ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{ID_FS_TYPE}="none", \
index 126012b..fd66cf6 100644 (file)
@@ -6,6 +6,8 @@ Before=local-fs-pre.target blk-availability.service
 After=multipathd.socket systemd-udev-trigger.service systemd-udev-settle.service
 DefaultDependencies=no
 Conflicts=shutdown.target
+ConditionKernelCommandLine=!nompath
+ConditionKernelCommandLine=!multipath=off
 
 [Service]
 Type=notify