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

64c563
commit 8fef90084f3d19e90ba1bb22b8cd1d58ddaf6ef3
64c563
Author: Steve Dickson <steved@redhat.com>
64c563
Date:   Tue Jun 21 12:06:06 2016 -0400
64c563
64c563
    start-statd: Use flock to serialize the running of this script
64c563
    
64c563
    To once and for all stop multiple rpc.statd from
64c563
    being started (mostly in HA environments), use
64c563
    flock to serialize the running of the script
64c563
    
64c563
    Signed-off-by: Steve Dickson <steved@redhat.com>
64c563
64c563
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
64c563
index 19e6eb2..2fd6039 100755
64c563
--- a/utils/statd/start-statd
64c563
+++ b/utils/statd/start-statd
64c563
@@ -6,6 +6,10 @@
64c563
 # site.
64c563
 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
64c563
 
64c563
+# Use flock to serialize the running of this script
64c563
+exec 200> /var/run/rpc.statd.lock
64c563
+flock -e 200
64c563
+
64c563
 if [ -s /var/run/rpc.statd.pid ] &&
64c563
        [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&
64c563
        kill -0 `cat /var/run/rpc.statd.pid` > /dev/null 2>&1