[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gnbd man/gnbd_export.8 tools/gnbd_expo ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	bmarzins sourceware org	2006-08-08 21:09:21

Modified files:
	gnbd/man       : gnbd_export.8 
	gnbd/tools/gnbd_export: gnbd_get_uid 

Log message:
	setting multiple locations for gnbd_get_uid to check for scsi_id, and updating
	the man page. Patches from Fabio

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gnbd/man/gnbd_export.8.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gnbd/tools/gnbd_export/gnbd_get_uid.diff?cvsroot=cluster&r1=1.2&r2=1.3

--- cluster/gnbd/man/gnbd_export.8	2006/06/02 00:39:37	1.4
+++ cluster/gnbd/man/gnbd_export.8	2006/08/08 21:09:21	1.5
@@ -130,7 +130,7 @@
 %n escape sequences. %M will be expanded to the major number of the exported
 device, %m will be expaned to the minor number of the exported device, and
 %n will be expanded to the sysfs name for the device. If no command is given,
-gnbd will use the default command \fI"/sbin/scsi_id -g -u -s /block/%n"\fR. This
+gnbd will use the default command \fI"/usr/sbin/gnbd_get_uid"\fR. This
 command will work for most scsi devices.
 .TP
 \fB-t\fP [\fIseconds\fR]
--- cluster/gnbd/tools/gnbd_export/gnbd_get_uid	2006/06/26 17:29:31	1.2
+++ cluster/gnbd/tools/gnbd_export/gnbd_get_uid	2006/08/08 21:09:21	1.3
@@ -1,7 +1,20 @@
 #!/bin/sh
 set -e
 
-base_uid=`/sbin/scsi_id -g -u -s /block/$1 2> /dev/null`
+oldpath=/sbin/scsi_id
+newpath=/lib/udev/scsi_id
+
+if [ -e "$newpath" ]; then
+	cmd="$newpath"
+else
+	if [ -e "$oldpath" ]; then
+		cmd="$oldpath"
+	else
+		exit 1
+	fi
+fi
+
+base_uid=`$cmd -g -u -s /block/$1 2> /dev/null`
 if echo $1 | grep -q '^.*\/[^0-9]*[0-9]*$' > /dev/null 2>&1 ; then
 	part=`echo $1 | sed 's/^.*\/[^0-9]*\([0-9]*\)$/\1/'`
 	echo GNBD-${part}-${base_uid}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]