Log message:
Fix for bz #456228. Patch applied from bugzilla. The multipath init script now
refuses to stop multipathd when the root device is a multipath device. This
was causing problems with shutdown on iSCSI devices.
+teardown_slaves()
+{
+cd $1;
+if [ -d "slaves" ]; then
+for slave in slaves/*;
+do
+ if [ "$slave" = "slaves/*" ]; then
+ read dev < $1/dev
+ tablename=`dmsetup table --target multipath | sed -n "s/(.*): .* $dev .*/1/p"`
+ if ! [ -z $tablename ]; then
+ echo "Root is on a multipathed device, multipathd can not be stopped"
+ exit 1
+ fi
+ else
+ local_slave=`readlink -f $slave`;
+ teardown_slaves $local_slave;
+ fi
+ done
+
+else
+ read dev < $1/dev
+ tablename=`dmsetup table --target multipath | sed -n "s/(.*): .* $dev .*/1/p"`
+ if ! [ -z $tablename ]; then
+ echo "Root is on a multipathed device, multipathd can not be stopped"
+ exit 1
+ fi
+fi
+}
+
#
# See how we were called.
#
@@ -40,6 +70,11 @@
}