Blame SOURCES/bz1225634-2-scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper.patch

db8e98
commit 60db3c365128dc8aa7e0d3c903c426c8a743b8e2
db8e98
Author: Andrew Price <anprice@redhat.com>
db8e98
Date:   Tue Aug 18 12:35:52 2015 +0100
db8e98
db8e98
    scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper
db8e98
    
db8e98
    Makes the name more descriptive and consistent with the name of the udev
db8e98
    rules script.
db8e98
    
db8e98
    Resolves: rhbz#1225634
db8e98
    Signed-off-by: Andrew Price <anprice@redhat.com>
db8e98
db8e98
diff --git a/README.build b/README.build
db8e98
index 6487bae..acfde1b 100644
db8e98
--- a/README.build
db8e98
+++ b/README.build
db8e98
@@ -35,7 +35,7 @@ are not installed by 'make install' and need to be installed manually
db8e98
 or during rpm installation to the corresponding locations.
db8e98
 
db8e98
 	82-gfs2-withdraw.rules in /etc/udev/rules.d/
db8e98
-	gfs2_wd_udev.sh        in /usr/sbin/
db8e98
+	gfs2_withdraw_helper   in /usr/sbin/
db8e98
 
db8e98
 See also doc/README.contributing for details on submitting patches and
db8e98
 doc/README.tests for more details regarding the test suite.
db8e98
diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules
db8e98
index 2228615..2c9e0e8 100644
db8e98
--- a/gfs2/scripts/82-gfs2-withdraw.rules
db8e98
+++ b/gfs2/scripts/82-gfs2-withdraw.rules
db8e98
@@ -1,2 +1,2 @@
db8e98
-SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh"
db8e98
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_withdraw_helper"
db8e98
 
db8e98
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
db8e98
index dde906f..51764fa 100644
db8e98
--- a/gfs2/scripts/Makefile.am
db8e98
+++ b/gfs2/scripts/Makefile.am
db8e98
@@ -6,5 +6,5 @@ dist_sbin_SCRIPTS = \
db8e98
 
db8e98
 noinst_SCRIPTS = \
db8e98
 	82-gfs2-withdraw.rules \
db8e98
-	gfs2_wd_udev.sh
db8e98
+	gfs2_withdraw_helper
db8e98
 
db8e98
diff --git a/gfs2/scripts/gfs2_wd_udev.sh b/gfs2/scripts/gfs2_wd_udev.sh
db8e98
deleted file mode 100755
db8e98
index ac3ce35..0000000
db8e98
--- a/gfs2/scripts/gfs2_wd_udev.sh
db8e98
+++ /dev/null
db8e98
@@ -1,30 +0,0 @@
db8e98
-#!/bin/sh
db8e98
-#
db8e98
-# Do not run this script manually. This script is called by udev on a gfs2
db8e98
-# withdraw uevent and is used to complete the withdraw action and notify the
db8e98
-# kernel.
db8e98
-#
db8e98
-
db8e98
-# Sanity checks
db8e98
-if [ "$SUBSYSTEM" != "gfs2" ] || [ "$LOCKPROTO" != "lock_dlm" ] ||
db8e98
-       [ -z "$DEVPATH" ] || [ "$ACTION" != "offline" ]
db8e98
-then
db8e98
-    exit 1 # Nothing to do here
db8e98
-fi
db8e98
-
db8e98
-# Try and suspend the device
db8e98
-SYSFS_TOPDIR="/sys"$DEVPATH
db8e98
-DM_NAME=$(cat "$SYSFS_TOPDIR/device/dm/name")
db8e98
-DM_DEV="/dev/mapper/"$DM_NAME
db8e98
-
db8e98
-if [ -z "$DM_DEV" ]
db8e98
-then
db8e98
-    /usr/bin/dmsetup suspend $DM_DEV
db8e98
-fi
db8e98
-
db8e98
-# Signal completion of withdraw
db8e98
-WD_ACK="$SYSFS_TOPDIR/lock_module/withdraw"
db8e98
-if [ -f "$WD_ACK" ]
db8e98
-then
db8e98
-    echo "1" > $WD_ACK
db8e98
-fi
db8e98
diff --git a/gfs2/scripts/gfs2_withdraw_helper b/gfs2/scripts/gfs2_withdraw_helper
db8e98
new file mode 100755
db8e98
index 0000000..ac3ce35
db8e98
--- /dev/null
db8e98
+++ b/gfs2/scripts/gfs2_withdraw_helper
db8e98
@@ -0,0 +1,30 @@
db8e98
+#!/bin/sh
db8e98
+#
db8e98
+# Do not run this script manually. This script is called by udev on a gfs2
db8e98
+# withdraw uevent and is used to complete the withdraw action and notify the
db8e98
+# kernel.
db8e98
+#
db8e98
+
db8e98
+# Sanity checks
db8e98
+if [ "$SUBSYSTEM" != "gfs2" ] || [ "$LOCKPROTO" != "lock_dlm" ] ||
db8e98
+       [ -z "$DEVPATH" ] || [ "$ACTION" != "offline" ]
db8e98
+then
db8e98
+    exit 1 # Nothing to do here
db8e98
+fi
db8e98
+
db8e98
+# Try and suspend the device
db8e98
+SYSFS_TOPDIR="/sys"$DEVPATH
db8e98
+DM_NAME=$(cat "$SYSFS_TOPDIR/device/dm/name")
db8e98
+DM_DEV="/dev/mapper/"$DM_NAME
db8e98
+
db8e98
+if [ -z "$DM_DEV" ]
db8e98
+then
db8e98
+    /usr/bin/dmsetup suspend $DM_DEV
db8e98
+fi
db8e98
+
db8e98
+# Signal completion of withdraw
db8e98
+WD_ACK="$SYSFS_TOPDIR/lock_module/withdraw"
db8e98
+if [ -f "$WD_ACK" ]
db8e98
+then
db8e98
+    echo "1" > $WD_ACK
db8e98
+fi