Skip to contentSkip to conversation

Various small multipath-tools improvements

PATCH In review Mike Snitzer 2 participants 10 messages Apr 17, 2009 – Apr 22, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Various small multipath-tools improvements

Just a few cleanup patches.

Mike Snitzer (4):
multipath-tools: update scsi_id arguments
multipath-tools: install libmultipath.so in $syslibdir
multipath-tools: update multipathd.init.redhat
multipath-tools: change default location for bindings file

 Makefile.inc                      |    1 +
 libmultipath/Makefile             |    6 +-
 libmultipath/defaults.h           |    4 +-
 libmultipath/hwtable.c            |    6 +-
 multipath.conf.annotated          |    6 +-
 multipath.conf.defaults           |   78 ++++++++++++++++++------------------
 multipath.conf.synthetic          |    4 +-
 multipath/Makefile                |    1 +
 multipath/multipath.conf.5        |    2 +-
 multipathd/multipathd.init.redhat |   30 +++++++--------
 10 files changed, 69 insertions(+), 69 deletions(-)
#1 lore raw

PATCH 1/4 multipath-tools: update scsi_id arguments

Switch over to using --whitelisted and --device

---
 libmultipath/defaults.h    |    2 +-
 libmultipath/hwtable.c     |    6 ++--
 multipath.conf.annotated   |    6 ++--
 multipath.conf.defaults    |   78 ++++++++++++++++++++++----------------------
 multipath.conf.synthetic   |    4 +-
 multipath/multipath.conf.5 |    2 +-
 6 files changed, 49 insertions(+), 49 deletions(-)
libmultipath/defaults.h +1 -1
index 87b155e..d7f93cb 100644
@@ -1,4 +1,4 @@
-#define DEFAULT_GETUID		"/lib/udev/scsi_id -g -u -d /dev/%n"
+#define DEFAULT_GETUID		"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
 #define DEFAULT_UDEVDIR		"/dev"
 #define DEFAULT_MULTIPATHDIR	"/lib/multipath"
 #define DEFAULT_SELECTOR	"round-robin 0"
libmultipath/hwtable.c +3 -3
index 1a51b19..52bced9 100644
@@ -193,7 +193,7 @@ static struct hwentry default_hw[] = {
 		/* HP Smart Array */
 		.vendor        = "HP",
 		.product       = "LOGICAL VOLUME.*",
-		.getuid        = "/lib/udev/scsi_id -n -g -u -d /dev/%n",
+		.getuid        = DEFAULT_GETUID,
 		.features      = DEFAULT_FEATURES,
 		.hwhandler     = DEFAULT_HWHANDLER,
 		.selector      = DEFAULT_SELECTOR,
@@ -235,7 +235,7 @@ static struct hwentry default_hw[] = {
 	{
 		.vendor        = "EMC",
 		.product       = "SYMMETRIX",
-		.getuid        = "/lib/udev/scsi_id -g -u -ppre-spc3-83 -d /dev/%n",
+		.getuid        = "/lib/udev/scsi_id --page=pre-spc3-83 --whitelisted --device=/dev/%n",
 		.features      = DEFAULT_FEATURES,
 		.hwhandler     = DEFAULT_HWHANDLER,
 		.selector      = DEFAULT_SELECTOR,
@@ -794,7 +794,7 @@ static struct hwentry default_hw[] = {
 	{
 		.vendor        = "PIVOT3",
 		.product       = "RAIGE VOLUME",
-		.getuid        = "/lib/udev/scsi_id -p 0x80 -g -u -d /dev/%n",
+		.getuid        = "/lib/udev/scsi_id --page=0x80 --whitelisted --device=/dev/%n",
 		.features      = "1 queue_if_no_path",
 		.hwhandler     = DEFAULT_HWHANDLER,
 		.selector      = DEFAULT_SELECTOR,
multipath.conf.annotated +3 -3
index 10aa5eb..7f5fe0d 100644
@@ -55,9 +55,9 @@
 #	# scope   : multipath
 #	# desc    : the default program and args to callout to obtain a unique 
 #	#           path identifier. Absolute path required
-#	# default : /lib/udev/scsi_id -g -u -s
+#	# default : /lib/udev/scsi_id --whitelisted --device=/dev/%n
 #	#
-#	getuid_callout	"/lib/udev/scsi_id -g -u -d /dev/%n"
+#	getuid_callout	"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
 #
 #	#
 #	# name    : prio
@@ -351,7 +351,7 @@
 #		# desc    : the program and args to callout to obtain a unique 
 #		#           path identifier. Absolute path required
 #		#
-#		getuid_callout          "/lib/udev/scsi_id -g -u -d /dev/%n"
+#		getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
 #
 #		#
 #		# name    : prio
multipath.conf.defaults +39 -39

312 lines not on this page · raw message

multipath.conf.synthetic +2 -2
index bf94c04..efa84f0 100644
@@ -7,7 +7,7 @@
 #	polling_interval 	10
 #	selector		"round-robin 0"
 #	path_grouping_policy	multibus
-#	getuid_callout		"/lib/udev/scsi_id -g -u -d /dev/%n"
+#	getuid_callout		"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
 #	prio			const
 #	path_checker		directio
 #	rr_min_io		100
@@ -52,7 +52,7 @@
 #		vendor			"COMPAQ  "
 #		product			"HSV110 (C)COMPAQ"
 #		path_grouping_policy	multibus
-#		getuid_callout          "/lib/udev/scsi_id -g -u -d /dev/%n"
+#		getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
 #		path_checker		directio
 #		path_selector		"round-robin 0"
 #		hardware_handler	"0"
multipath/multipath.conf.5 +1 -1
index c02245c..057dd83 100644
@@ -109,7 +109,7 @@ Default value is \fImultibus\fR.
 The default program and args to callout to obtain a unique path
 identifier. Should be specified with an absolute path. Default value
 is
-.I /lib/udev/scsi_id -g -u -d /dev/%n
+.I /lib/udev/scsi_id --whitelisted --device=/dev/%n
 .TP
 .B prio_callout
 The default program and args to callout to obtain a path priority
Signature · 1 line
1.6.0.6
#2 lore raw

PATCH 2/4 multipath-tools: install libmultipath.so in $syslibdir

In reply to Mike Snitzer

Allows libmultipath.so to be installed in the proper lib dir (e.g. /lib64). $libdir is already used for /lib/multipath

---
 Makefile.inc          |    1 +
 libmultipath/Makefile |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
Makefile.inc +1 -0
index 3e5bca0..1fe9782 100644
@@ -21,6 +21,7 @@ multipathdir = $(TOPDIR)/libmultipath
 mandir      = $(prefix)/usr/share/man/man8
 man5dir     = $(prefix)/usr/share/man/man5
 rcdir	    = $(prefix)/etc/init.d
+syslibdir   = $(prefix)/lib
 libdir	    = $(prefix)/lib/multipath
 
 GZIP        = /bin/gzip -9 -c
libmultipath/Makefile +3 -3
index 35cb911..503223d 100644
@@ -26,12 +26,12 @@ $(LIBS): $(OBJS)
 	$(CC) $(SHARED_FLAGS) -Wl,-soname,$@ $(CFLAGS) -o $@ $(OBJS)
 
 install:
-	$(INSTALL_PROGRAM) -d $(DESTDIR)$(prefix)/lib
-	$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(prefix)/lib/$(LIBS)
+	$(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir)
+	$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS)
 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(libdir)
 
 uninstall:
-	rm -f $(DESTDIR)$(prefix)/lib/$(LIBS)
+	rm -f $(DESTDIR)$(syslibdir)/$(LIBS)
 
 clean:
 	rm -f core *.a *.o *.gz *.so
Signature · 1 line
1.6.0.6
#3 lore raw

Re: [PATCH 2/4] multipath-tools: install libmultipath.so in $syslibdir

Quoted 3 lines · Mike Snitzer

Allows libmultipath.so to be installed in the proper lib dir (e.g. /lib64). $libdir is already used for /lib/multipath

Mike,
am I missing something ... I don't the lib/lib64 switching code.

Quoted 38 lines
---
 Makefile.inc          |    1 +
 libmultipath/Makefile |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
Makefile.inc +1 -0
index 3e5bca0..1fe9782 100644
@@ -21,6 +21,7 @@ multipathdir = $(TOPDIR)/libmultipath
 mandir      = $(prefix)/usr/share/man/man8
 man5dir     = $(prefix)/usr/share/man/man5
 rcdir	    = $(prefix)/etc/init.d
+syslibdir   = $(prefix)/lib
 libdir	    = $(prefix)/lib/multipath
 
 GZIP        = /bin/gzip -9 -c
libmultipath/Makefile +3 -3
index 35cb911..503223d 100644
@@ -26,12 +26,12 @@ $(LIBS): $(OBJS)
 	$(CC) $(SHARED_FLAGS) -Wl,-soname,$@ $(CFLAGS) -o $@ $(OBJS)
 
 install:
-	$(INSTALL_PROGRAM) -d $(DESTDIR)$(prefix)/lib
-	$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(prefix)/lib/$(LIBS)
+	$(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir)
+	$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS)
 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(libdir)
 
 uninstall:
-	rm -f $(DESTDIR)$(prefix)/lib/$(LIBS)
+	rm -f $(DESTDIR)$(syslibdir)/$(LIBS)
 
 clean:
 	rm -f core *.a *.o *.gz *.so
#4 lore raw

Re: [PATCH 2/4] multipath-tools: install libmultipath.so in $syslibdir

Quoted 7 lines · Christophe Varoqui
Quoted 3 lines · Mike Snitzer

Allows libmultipath.so to be installed in the proper lib dir (e.g. /lib64). $libdir is already used for /lib/multipath

Mike,
am I missing something ... I don't the lib/lib64 switching code.

The standard install would still just place libmultipath.so in /lib but this patch exposes the ability to override the default e.g.:
make install syslibdir=/lib64 libdir=/lib64/multipath

The path checker and prioritizer modules would get installed in /lib64/multipath and libmultipath.so in /lib64

Quoted 42 lines
Quoted 27 lines
---
 Makefile.inc          |    1 +
 libmultipath/Makefile |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
Makefile.inc +1 -0
index 3e5bca0..1fe9782 100644
@@ -21,6 +21,7 @@ multipathdir = $(TOPDIR)/libmultipath
 mandir      = $(prefix)/usr/share/man/man8
 man5dir     = $(prefix)/usr/share/man/man5
 rcdir	    = $(prefix)/etc/init.d
+syslibdir   = $(prefix)/lib
 libdir	    = $(prefix)/lib/multipath
 
 GZIP        = /bin/gzip -9 -c
libmultipath/Makefile +0 -2
index 35cb911..503223d 100644
@@ -26,12 +26,12 @@ $(LIBS): $(OBJS)
 	$(CC) $(SHARED_FLAGS) -Wl,-soname,$@ $(CFLAGS) -o $@ $(OBJS)
 
 install:
-	$(INSTALL_PROGRAM) -d $(DESTDIR)$(prefix)/lib
-	$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(prefix)/lib/$(LIBS)

libmultipath/Makefile $(LIBS): $(OBJS) · line 37

Quoted 10 lines
libmultipath/Makefile +3 -1
+	$(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir)
+	$(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS)
 	$(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(libdir)
 
 uninstall:
-	rm -f $(DESTDIR)$(prefix)/lib/$(LIBS)
+	rm -f $(DESTDIR)$(syslibdir)/$(LIBS)
 
 clean:
 	rm -f core *.a *.o *.gz *.so

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#5 lore raw

Re: Re: [PATCH 2/4] multipath-tools: install libmultipath.so in $syslibdir

Quoted 5 lines
Quoted 4 lines

Mike,
am I missing something ... I don't the lib/lib64 switching code.

Quoted 7 lines

The standard install would still just place libmultipath.so in /lib but this patch exposes the ability to override the default e.g.:
make install syslibdir=/lib64 libdir=/lib64/multipath

The path checker and prioritizer modules would get installed in /lib64/multipath and libmultipath.so in /lib64

Oh ok, I was expecting some kind of detection code to set /lib64. I understand that this approach is sufficient for your packagers needs.

Thanks for explaining.

#6 lore raw

PATCH 3/4 multipath-tools: update multipathd.init.redhat

In reply to Mike Snitzer

Various small improvements to Red Hat's multipathd initscript.

---
 multipathd/multipathd.init.redhat |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)
multipathd/multipathd.init.redhat +14 -16
index 4664212..ee776f0 100644
@@ -1,13 +1,16 @@
 #!/bin/bash
-
-#
-#	/etc/rc.d/init.d/multipathd
 #
-# Starts the multipath daemon
+# multipathd	Starts the multipath daemon
 #
 # chkconfig: - 13 87
-# description: Manage device-mapper multipath devices
-# processname: multipathd
+# description: Manages device-mapper multipath devices
+
+### BEGIN INIT INFO
+# Provides: multipathd
+# Short-Description: Control multipathd
+# Description: This service monitors and manages
+#              device-mapper multipath devices
+### END INIT INFO
 
 DAEMON=/sbin/multipathd
 prog=`basename $DAEMON`
@@ -16,14 +19,8 @@ lockdir=/var/lock/subsys
 sysconfig=/etc/sysconfig
 
  
-system=redhat
- 
-if [ $system = redhat ]; then
-	# Source function library.
-	. $initdir/functions
-fi
+. $initdir/functions
  
-test -x $DAEMON || exit 0
 test -r $sysconfig/$prog && . $sysconfig/$prog
 
 RETVAL=0
@@ -33,6 +30,7 @@ RETVAL=0
 #
 
 start() {
+	test -x $DAEMON || exit 5
 	echo -n $"Starting $prog daemon: "
 	daemon $DAEMON
 	RETVAL=$?
@@ -68,13 +66,13 @@ start)
 stop)
 	stop
 	;;
-reload)
+force-reload|reload)
 	reload
 	;;
 restart)
 	restart
 	;;
-condrestart)
+condrestart|try-restart)
 	if [ -f $lockdir/$prog ]; then
 	    restart
 	fi
@@ -85,7 +83,7 @@ status)
 	;;
 *)
 	echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
-	RETVAL=1
+	RETVAL=2
 esac
 
 exit $RETVAL
Signature · 1 line
1.6.0.6
#7 lore raw

PATCH 4/4 multipath-tools: change default location for bindings file

In reply to Mike Snitzer

Change from /var/lib/multipath/bindings to /etc/multipath/bindings. On bootup, if /var is not on the same device as /, multipath may start up before /var is mounted. /etc will always be available. Use of /etc/multipath/ is to make selinux happy.

---
 libmultipath/defaults.h |    2 +-
 multipath/Makefile      |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
libmultipath/defaults.h +1 -1
index d7f93cb..4bd0a8b 100644
@@ -18,6 +18,6 @@
 #define DEFAULT_PIDFILE		"/var/run/multipathd.pid"
 #define DEFAULT_SOCKET		"/var/run/multipathd.sock"
 #define DEFAULT_CONFIGFILE	"/etc/multipath.conf"
-#define DEFAULT_BINDINGS_FILE	"/var/lib/multipath/bindings"
+#define DEFAULT_BINDINGS_FILE	"/etc/multipath/bindings"
 
 char * set_default (char * str);
multipath/Makefile +1 -0
index e0031a2..1f48a8f 100644
@@ -27,6 +27,7 @@ install:
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
 	$(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir)
+	$(INSTALL_PROGRAM) -d $(DESTDIR)/etc/multipath
 
 uninstall:
 	rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
Signature · 1 line
1.6.0.6
#8 lore raw
In reply to Mike Snitzer

Hi Mike,
thank you for these patches.
Do you happen to have a fetchable git clone to ease integration ?

----- Mail Original -----
De: "Mike Snitzer" <[email protected]>
À: [email protected]
Envoyé: Samedi 18 Avril 2009 00h07:56 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: [dm-devel] [PATCH 0/4] Various small multipath-tools improvements

Just a few cleanup patches.

Mike Snitzer (4):
multipath-tools: update scsi_id arguments
multipath-tools: install libmultipath.so in $syslibdir
multipath-tools: update multipathd.init.redhat
multipath-tools: change default location for bindings file

 Makefile.inc                      |    1 +
 libmultipath/Makefile             |    6 +-
 libmultipath/defaults.h           |    4 +-
 libmultipath/hwtable.c            |    6 +-
 multipath.conf.annotated          |    6 +-
 multipath.conf.defaults           |   78 ++++++++++++++++++------------------
 multipath.conf.synthetic          |    4 +-
 multipath/Makefile                |    1 +
 multipath/multipath.conf.5        |    2 +-
 multipathd/multipathd.init.redhat |   30 +++++++--------
 10 files changed, 69 insertions(+), 69 deletions(-)

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#9 lore raw

Hi Christophe,

I don't have a public git tree at the moment but I can look to get one setup for future patches. The patches that I posted should apply cleanly to the current HEAD (49944a3d5).

BTW, agk pointed out that moving the bindings file may require that some logic be added to migrate the old bindings to the new location. I haven't looked into it yet but will do so shortly. But for now it is probably safest to not apply the change to the bindings file location (patch 4).

Mike

Quoted 39 lines · On Sat, Apr 18 2009 at 1:41pm -0400, [email protected]…

Hi Mike,
thank you for these patches.
Do you happen to have a fetchable git clone to ease integration ?

----- Mail Original -----
De: "Mike Snitzer" <[email protected]>
À: [email protected]
Envoyé: Samedi 18 Avril 2009 00h07:56 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: [dm-devel] [PATCH 0/4] Various small multipath-tools improvements

Just a few cleanup patches.

Mike Snitzer (4):
multipath-tools: update scsi_id arguments
multipath-tools: install libmultipath.so in $syslibdir
multipath-tools: update multipathd.init.redhat
multipath-tools: change default location for bindings file

 Makefile.inc                      |    1 +
 libmultipath/Makefile             |    6 +-
 libmultipath/defaults.h           |    4 +-
 libmultipath/hwtable.c            |    6 +-
 multipath.conf.annotated          |    6 +-
 multipath.conf.defaults           |   78 ++++++++++++++++++------------------
 multipath.conf.synthetic          |    4 +-
 multipath/Makefile                |    1 +
 multipath/multipath.conf.5        |    2 +-
 multipathd/multipathd.init.redhat |   30 +++++++--------
 10 files changed, 69 insertions(+), 69 deletions(-)

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel