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

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