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

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