Blame SOURCES/bz1757753-nfsserver-1-systemd-perf-improvements.patch

011c77
From 530c48138f7dedaf99ae1ca98865d2f8b7432475 Mon Sep 17 00:00:00 2001
011c77
From: Eberhard Kuemmerle <E.Kuemmerle@fz-juelich.de>
011c77
Date: Thu, 12 Sep 2019 21:10:43 +0200
011c77
Subject: [PATCH] nfsserver: performance improvements for systemd enabled
011c77
 systems
011c77
011c77
> I found two critical actions in the script:
011c77
> - systemctl status nfs-server  (which also calls journalctl)
011c77
> - systemctl list-unit-files
011c77
011c77
source:
011c77
https://lists.clusterlabs.org/pipermail/developers/2019-September/002214.html
011c77
---
011c77
 heartbeat/nfsserver | 37 +++++++++++++++++++------------------
011c77
 1 file changed, 19 insertions(+), 18 deletions(-)
011c77
011c77
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
011c77
index bf59da98e..8527a90f3 100755
011c77
--- a/heartbeat/nfsserver
011c77
+++ b/heartbeat/nfsserver
011c77
@@ -233,24 +233,25 @@ set_exec_mode()
011c77
 		return 0
011c77
 	fi
011c77
 
011c77
-	##
011c77
-	# Attempt systemd (with nfs-lock.service).
011c77
-	##
011c77
 	if which systemctl > /dev/null 2>&1; then
011c77
-		if systemctl list-unit-files | grep nfs-server > /dev/null && systemctl list-unit-files | grep nfs-lock > /dev/null; then
011c77
-			EXEC_MODE=2
011c77
-			# when using systemd, the nfs-lock service file handles nfsv3 locking daemons for us.
011c77
-			return 0
011c77
-		fi
011c77
-	fi
011c77
+		if systemctl list-unit-files 'nfs-*' | grep nfs-server > /dev/null; then
011c77
+
011c77
+			##
011c77
+			# Attempt systemd (with nfs-lock.service).
011c77
+			##
011c77
+			if systemctl list-unit-files 'nfs-*' | grep nfs-lock > /dev/null; then
011c77
+				EXEC_MODE=2
011c77
+				# when using systemd, the nfs-lock service file handles nfsv3 locking daemons for us.
011c77
+				return 0
011c77
+			fi
011c77
 
011c77
-	##
011c77
-	# Attempt systemd (with rpc-statd.service).
011c77
-	##
011c77
-	if which systemctl > /dev/null 2>&1; then
011c77
-		if systemctl list-unit-files | grep nfs-server > /dev/null && systemctl list-unit-files | grep rpc-statd > /dev/null; then
011c77
-			EXEC_MODE=3
011c77
-			return 0
011c77
+			##
011c77
+			# Attempt systemd (with rpc-statd.service).
011c77
+			##
011c77
+			if systemctl list-unit-files 'rpc-*' | grep rpc-statd > /dev/null; then
011c77
+				EXEC_MODE=3
011c77
+				return 0
011c77
+			fi
011c77
 		fi
011c77
 	fi
011c77
 
011c77
@@ -272,12 +273,12 @@ nfs_exec()
011c77
 		2) if ! echo $svc | grep -q "\."; then
011c77
 			svc="${svc}.service"
011c77
 		   fi
011c77
-		   systemctl $cmd $svc
011c77
+		   systemctl -n0 $cmd $svc
011c77
 		   ;;
011c77
 		3) if ! echo $svc | grep -q "\."; then
011c77
 			svc="${svc}.service"
011c77
 		   fi
011c77
-		   systemctl $cmd $svc
011c77
+		   systemctl -n0 $cmd $svc
011c77
 		   ;;
011c77
 	esac
011c77
 }