[Cluster-devel] [PATCH 002/003] gnbd: get uid support new udev

Fabio M. Di Nitto fabbione at ubuntu.com
Tue Jul 25 08:19:05 UTC 2006


newer udev doesn't install its helpers in /sbin but in /lib/udev/.

Make sure to support both old and new instances in the wrapper.

diff -urNad redhat-cluster-suite-2.20060716~/gnbd/tools/gnbd_export/gnbd_get_uid redhat-cluster-suite-2.20060716/gnbd/tools/gnbd_export/gnbd_get_uid
--- redhat-cluster-suite-2.20060716~/gnbd/tools/gnbd_export/gnbd_get_uid	2006-06-26 19:29:31.000000000 +0200
+++ redhat-cluster-suite-2.20060716/gnbd/tools/gnbd_export/gnbd_get_uid	2006-07-20 05:57:51.000000000 +0200
@@ -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}




More information about the Cluster-devel mailing list