[pve-devel] [PATCH 1/2] gfs2-utils: Fixed patches for updated GFS2

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 27 16:25:45 CEST 2015


Removed old, for the actual gfs2 version (3.1.8), unnecessary patch.
Made patch for gfs2 lockcapture, so that it uses corosync tools directly.
We do not throw an error when no GFS2 entry is in /etc/fstab, because
there cannot possible be an entry after the first installation and it's
very confusing to get an error at this point. A info message should be
enough. Using gfs2-utils.git tag 3.1.8 for this build.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 ...001-Migrating-from-cman-to-corosync-tools.patch | 89 ++++++++++++++++++++++
 debian/patches/fix-gfs-init.d-scripts.patch        | 58 --------------
 debian/patches/series                              |  2 +-
 3 files changed, 90 insertions(+), 59 deletions(-)
 create mode 100644 debian/patches/0001-Migrating-from-cman-to-corosync-tools.patch
 delete mode 100644 debian/patches/fix-gfs-init.d-scripts.patch

diff --git a/debian/patches/0001-Migrating-from-cman-to-corosync-tools.patch b/debian/patches/0001-Migrating-from-cman-to-corosync-tools.patch
new file mode 100644
index 0000000..8228163
--- /dev/null
+++ b/debian/patches/0001-Migrating-from-cman-to-corosync-tools.patch
@@ -0,0 +1,89 @@
+From 93dce585f94c6f3a3d8653762fab1f54d1809fca Mon Sep 17 00:00:00 2001
+From: Thomas Lamprecht <t.lamprecht at proxmox.com>
+Date: Thu, 23 Jul 2015 16:37:15 +0200
+Subject: [PATCH] Migrating from cman to corosync tools
+
+Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
+---
+ gfs2/init.d/gfs2              |  6 +++---
+ gfs2/scripts/gfs2_lockcapture | 27 ++-------------------------
+ 2 files changed, 5 insertions(+), 28 deletions(-)
+ mode change 100644 => 100755 gfs2/init.d/gfs2
+ mode change 100644 => 100755 gfs2/scripts/gfs2_lockcapture
+
+diff --git a/gfs2/init.d/gfs2 b/gfs2/init.d/gfs2
+old mode 100644
+new mode 100755
+index 467f37b..dd9ae2a
+--- a/gfs2/init.d/gfs2
++++ b/gfs2/init.d/gfs2
+@@ -7,8 +7,8 @@
+ 
+ ### BEGIN INIT INFO
+ # Provides:		gfs2
+-# Required-Start:	$network cman gfs_controld
+-# Required-Stop:	$network cman gfs_controld
++# Required-Start:	$network pve-cluster
++# Required-Stop:	$network pve-cluster
+ # Default-Start:
+ # Default-Stop:
+ # Short-Description:	mount/unmount gfs2 filesystems configured in /etc/fstab
+@@ -72,7 +72,7 @@ GFS2MTAB=$(LC_ALL=C awk '!/^#/ && $3 == "gfs2" && $2 != "/" { print $2 }' /proc/
+ 
+ if [ -z "$GFS2FSTAB" ]; then
+ 	echo "GFS2: no entries found in /etc/fstab"
+-	exit 6
++	exit 0 # doesn't have to be an error
+ fi
+ 
+ # See how we were called.
+diff --git a/gfs2/scripts/gfs2_lockcapture b/gfs2/scripts/gfs2_lockcapture
+old mode 100644
+new mode 100755
+index 8839818..222693d
+--- a/gfs2/scripts/gfs2_lockcapture
++++ b/gfs2/scripts/gfs2_lockcapture
+@@ -595,20 +595,7 @@ def getClusterNode(listOfGFS2Names):
+     clusterName = ""
+     clusternodeName = ""
+     clusternodeID = ""
+-    if (runCommand("which", ["cman_tool"])):
+-        stdout = runCommandOutput("cman_tool", ["status"])
+-        if (not stdout == None):
+-            stdoutSplit = stdout.split("\n")
+-            clusterName = ""
+-            clusternodeName = ""
+-            for line in stdoutSplit:
+-                if (line.startswith("Cluster Name:")):
+-                    clusterName = line.split("Cluster Name:")[1].strip().rstrip()
+-                if (line.startswith("Node name: ")):
+-                    clusternodeName = line.split("Node name:")[1].strip().rstrip()
+-                if (line.startswith("Node ID: ")):
+-                    clusternodeID = line.split("Node ID: ")[1].strip().rstrip()
+-    elif (runCommand("which", ["corosync-cmapctl"])):
++    if (runCommand("which", ["corosync-cmapctl"])):
+         # Another way to get the local cluster node is: $ crm_node -i; crm_node -l
+         # Get the name of the cluster.
+         stdout = runCommandOutput("corosync-cmapctl", ["-g", "totem.cluster_name"])
+@@ -865,17 +852,7 @@ def gatherOptionalDiagnosticData(pathToDSTDir):
+         logging.getLogger(MAIN_LOGGER_NAME).error(message)
+ 
+     # Write the status of all the nodes in the cluster out.
+-    if (runCommand("which", ["cman_tool"])):
+-        command = "cman_tool"
+-        pathToCommandOutput = os.path.join(pathToDSTDir, "cman_tool_status")
+-        try:
+-            fout = open(pathToCommandOutput, "w")
+-            runCommand(command, ["status"], standardOut=fout)
+-            fout.close()
+-        except IOError:
+-            message = "There was an error the command output for %s to the file %s." %(command, pathToCommandOutput)
+-            logging.getLogger(MAIN_LOGGER_NAME).error(message)
+-    elif (runCommand("which", ["corosync-cmapctl"])):
++    if (runCommand("which", ["corosync-quorumtool"])):
+         command = "corosync-quorumtool"
+         pathToCommandOutput = os.path.join(pathToDSTDir, "corosync-quorumtool_l")
+         try:
+-- 
+2.1.4
+
diff --git a/debian/patches/fix-gfs-init.d-scripts.patch b/debian/patches/fix-gfs-init.d-scripts.patch
deleted file mode 100644
index b025bf1..0000000
--- a/debian/patches/fix-gfs-init.d-scripts.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Index: new/gfs2/init.d/gfs2-cluster
-===================================================================
---- new.orig/gfs2/init.d/gfs2-cluster	2012-02-17 09:01:54.000000000 +0100
-+++ new/gfs2/init.d/gfs2-cluster	2012-02-17 10:09:57.000000000 +0100
-@@ -19,27 +19,28 @@
- # Description: Starts and stops gfs_controld for dlm based GFS2 filesystems
- ### END INIT INFO
- 
--. /etc/rc.d/init.d/functions
-+. /lib/lsb/init-functions
- 
- prog="gfs_controld"
--lockfile="/var/lock/subsys/$prog"
-+lockfile="/var/lock/$prog"
- exec="/usr/sbin/$prog"
-+DESC="GFS2 Control Daemon"
- 
- start() {
- 	[ -x $exec ] || exit 5
--	echo -n $"Starting $prog: "
--	daemon $prog
-+	log_daemon_msg "Starting $DESC" "$prog"
-+	start_daemon $exec
- 	retval=$?
--	echo
-+	log_end_msg $retval
- 	[ $retval -eq 0 ] && touch $lockfile
- 	return $retval
- }
- 
- stop() {
--	echo -n $"Stopping $prog: "
-+	log_daemon_msg "Stopping $DESC" "$prog"
- 	killproc $prog
- 	retval=$?
--	echo
-+	log_end_msg $retval
- 	[ $retval -eq 0 ] && rm -f $lockfile
- }
- 
-@@ -53,7 +54,7 @@
- }
- 
- rh_status() {
--	status $prog
-+        status_of_proc $exec $prog
- }
- 
- rh_status_q() {
-@@ -87,7 +88,7 @@
- 		restart
- 		;;
- 	*)
--		echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
-+		echo "Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- 		exit 2
- esac
- exit $?
diff --git a/debian/patches/series b/debian/patches/series
index d895426..65ff56b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-fix-gfs-init.d-scripts.patch
+0001-Migrating-from-cman-to-corosync-tools.patch
-- 
2.1.4




More information about the pve-devel mailing list