Blame SOURCES/nfs-utils-1.3.0-start-statd-once.patch

851484
diff -up nfs-utils-1.3.0/utils/statd/start-statd.orig nfs-utils-1.3.0/utils/statd/start-statd
851484
--- nfs-utils-1.3.0/utils/statd/start-statd.orig	2016-04-14 14:16:47.608999000 -0400
851484
+++ nfs-utils-1.3.0/utils/statd/start-statd	2016-04-26 11:04:26.019962000 -0400
851484
@@ -1,4 +1,4 @@
851484
-#!/bin/bash -p
851484
+#!/bin/sh
851484
 # nfsmount calls this script when mounting a filesystem with locking
851484
 # enabled, but when statd does not seem to be running (based on
851484
 # /var/run/rpc.statd.pid).
851484
@@ -6,11 +6,19 @@
851484
 # site.
851484
 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
851484
 
851484
+if [ -s /var/run/rpc.statd.pid ] &&
851484
+       [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&
851484
+       kill -0 `cat /var/run/rpc.statd.pid` > /dev/null 2>&1
851484
+then
851484
+    # statd already running - must have been slow to respond.
851484
+    exit 0
851484
+fi
851484
 # First try systemd if it's installed.
851484
 if [ -d /run/systemd/system ]; then
851484
-	# Quit only if the call worked.
851484
-	systemctl start rpc-statd.service && exit
851484
+    # Quit only if the call worked.
851484
+    systemctl start rpc-statd.service && exit
851484
 fi
851484
 
851484
+cd /
851484
 # Fall back to launching it ourselves.
851484
 exec rpc.statd --no-notify