Skip to contentSkip to conversation

gfs2-utils: Withdraw helper script integration

PATCH New Andrew Price 2 participants 5 messages Aug 19, 2015

lore
Share & tools
lore
#0 lore raw

cover gfs2-utils: Withdraw helper script integration

Here are a 3 small patches which hook the withdraw scripts up to the build system so that they get installed by 'make install'.

Cheers,
Andy

Andrew Price (3):
scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper
scripts: install the withdraw helper script
scripts: install the withdraw udev rules script

 README.build                        |  7 +++----
 configure.ac                        |  8 ++++++++
 gfs2/scripts/82-gfs2-withdraw.rules |  2 +-
 gfs2/scripts/Makefile.am            | 10 +++++-----
 gfs2/scripts/gfs2_wd_udev.sh        | 30 ------------------------------
 gfs2/scripts/gfs2_withdraw_helper   | 30 ++++++++++++++++++++++++++++++
 6 files changed, 47 insertions(+), 40 deletions(-)
 delete mode 100755 gfs2/scripts/gfs2_wd_udev.sh
 create mode 100755 gfs2/scripts/gfs2_withdraw_helper
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/3 scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper

Makes the name more descriptive and consistent with the name of the udev rules script.

---
 README.build                                           | 2 +-
 gfs2/scripts/82-gfs2-withdraw.rules                    | 2 +-
 gfs2/scripts/Makefile.am                               | 2 +-
 gfs2/scripts/{gfs2_wd_udev.sh => gfs2_withdraw_helper} | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename gfs2/scripts/{gfs2_wd_udev.sh => gfs2_withdraw_helper} (100%)
README.build +1 -1
index 6487bae..acfde1b 100644
@@ -35,7 +35,7 @@ are not installed by 'make install' and need to be installed manually
 or during rpm installation to the corresponding locations.
 
 	82-gfs2-withdraw.rules in /etc/udev/rules.d/
-	gfs2_wd_udev.sh        in /usr/sbin/
+	gfs2_withdraw_helper   in /usr/sbin/
 
 See also doc/README.contributing for details on submitting patches and
 doc/README.tests for more details regarding the test suite.
gfs2/scripts/82-gfs2-withdraw.rules +1 -1
index 2228615..2c9e0e8 100644
@@ -1,2 +1,2 @@
-SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh"
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_withdraw_helper"
 
gfs2/scripts/Makefile.am +1 -1
index dde906f..51764fa 100644
@@ -6,5 +6,5 @@ dist_sbin_SCRIPTS = \
 
 noinst_SCRIPTS = \
 	82-gfs2-withdraw.rules \
-	gfs2_wd_udev.sh
+	gfs2_withdraw_helper
 
gfs2/scripts/gfs2_withdraw_helper renamed from gfs2/scripts/gfs2_wd_udev.sh +0 -0
similarity index 100%
rename from gfs2/scripts/gfs2_wd_udev.sh
rename to gfs2/scripts/gfs2_withdraw_helper
Signature · 1 line
2.4.3
#2 lore raw

PATCH 2/3 scripts: install the withdraw helper script

In reply to Andrew Price

Install gfs2_withdraw_helper into /usr/sbin in 'make install'.

---
 gfs2/scripts/Makefile.am | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
gfs2/scripts/Makefile.am +3 -3
index 51764fa..056aaa5 100644
@@ -2,9 +2,9 @@ MAINTAINERCLEANFILES = Makefile.in
 
 dist_sbin_SCRIPTS = \
 	gfs2_lockcapture \
-	gfs2_trace
+	gfs2_trace \
+	gfs2_withdraw_helper
 
 noinst_SCRIPTS = \
-	82-gfs2-withdraw.rules \
-	gfs2_withdraw_helper
+	82-gfs2-withdraw.rules
 
Signature · 1 line
2.4.3
#3 lore raw

PATCH 3/3 scripts: install the withdraw udev rules script

In reply to Andrew Price

Add a --with-udevdir configure option and default to $prefix/lib/udev. Note that we can't use $libdir for this as that will often be /usr/lib64 and the udevdir is arch-independent.

Also add the autoconf bits needed to install 82-gfs2-withdraw.rules into $udevdir/rules.d

---
 README.build             | 5 ++---
 configure.ac             | 8 ++++++++
 gfs2/scripts/Makefile.am | 4 ++--
 3 files changed, 12 insertions(+), 5 deletions(-)
README.build +2 -3
index acfde1b..d0a21c3 100644
@@ -31,10 +31,9 @@ To install gfs2-utils, run:
 
 The following scripts (located in gfs2/scripts) are used to complete
 the userland portion of the gfs2 withdraw feature using uevents. They
-are not installed by 'make install' and need to be installed manually
-or during rpm installation to the corresponding locations.
+will be installed by 'make install' to these directories by default:
 
-	82-gfs2-withdraw.rules in /etc/udev/rules.d/
+	82-gfs2-withdraw.rules in /usr/lib/udev/rules.d/
 	gfs2_withdraw_helper   in /usr/sbin/
 
 See also doc/README.contributing for details on submitting patches and
configure.ac +8 -0
index de96e5a..35cafe6 100644
@@ -110,6 +110,12 @@ if test -z "$ncurses_CFLAGS"  && test -z "$ncurses_LIBS"; then
 	ncurses_LIBS=-lncurses
 fi
 
+AC_ARG_WITH([udevdir],
+            AS_HELP_STRING([--with-udevdir=DIR],
+                           [udev directory containing rules.d [default=${prefix}/lib/udev]]),
+            [], [with_udevdir=\${prefix}/lib/udev])
+AC_SUBST([udevdir], [$with_udevdir])
+
 # Checks for header files.
 AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h])
 AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])])
@@ -209,7 +215,9 @@ echo "  Configure summary"
 echo " ==================="
 echo " prefix            : $prefix"
 echo " exec_prefix       : $exec_prefix"
+echo " libdir            : $libdir"
 echo " sbindir           : $sbindir"
+echo " udevdir           : $udevdir"
 echo " ------------------"
 echo " debug build       : $enable_debug"
 echo " C unit tests      : $have_check"
gfs2/scripts/Makefile.am +2 -2
index 056aaa5..d4bda04 100644
@@ -5,6 +5,6 @@ dist_sbin_SCRIPTS = \
 	gfs2_trace \
 	gfs2_withdraw_helper
 
-noinst_SCRIPTS = \
+udevrulesdir=@udevdir@/rules.d
+dist_udevrules_DATA = \
 	82-gfs2-withdraw.rules
-
Signature · 1 line
2.4.3
#4 lore raw

cover gfs2-utils: Withdraw helper script integration

In reply to Andrew Price

These look good to me. Thanks for sorting it out.
ACK.

Cheers!
--Abhi

----- Original Message -----

Quoted 30 lines

From: "Andrew Price" <[email protected]>
To: cluster-devel at redhat.com
Sent: Wednesday, August 19, 2015 6:55:06 AM
Subject: [Cluster-devel] [PATCH 0/3] gfs2-utils: Withdraw helper script integration

Here are a 3 small patches which hook the withdraw scripts up to the build system so that they get installed by 'make install'.

Cheers,
Andy

Andrew Price (3):
scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper
scripts: install the withdraw helper script
scripts: install the withdraw udev rules script

 README.build                        |  7 +++----
 configure.ac                        |  8 ++++++++
 gfs2/scripts/82-gfs2-withdraw.rules |  2 +-
 gfs2/scripts/Makefile.am            | 10 +++++-----
 gfs2/scripts/gfs2_wd_udev.sh        | 30 ------------------------------
 gfs2/scripts/gfs2_withdraw_helper   | 30 ++++++++++++++++++++++++++++++
 6 files changed, 47 insertions(+), 40 deletions(-)
 delete mode 100755 gfs2/scripts/gfs2_wd_udev.sh
 create mode 100755 gfs2/scripts/gfs2_withdraw_helper

--
2.4.3