Skip to contentSkip to conversation

start-statd: Use flock to serialize the running of this script

PATCH In review Steve Dickson 1 participant 2 messages Jun 20, 2016 – Jun 21, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 start-statd: Use flock to serialize the running of this script

To once and for all stop multiple rpc.statd from
being started (mostly in HA environments), use
flock to serialize the running of the script

---
 utils/statd/start-statd | 4 ++++
 1 file changed, 4 insertions(+)
utils/statd/start-statd +4 -0
index 19e6eb2..2fd6039 100755
@@ -6,6 +6,10 @@
 # site.
 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 
+# Use flock to serialize the running of this script
+exec 200> /var/run/rpc.statd.lock
+flock -e 200
+
 if [ -s /var/run/rpc.statd.pid ] &&
        [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&
        kill -0 `cat /var/run/rpc.statd.pid` > /dev/null 2>&1
Signature · 1 line
2.5.5
#1 lore raw
Quoted 5 lines · Steve Dickson

To once and for all stop multiple rpc.statd from
being started (mostly in HA environments), use
flock to serialize the running of the script

Committed...

steved.

Quoted 20 lines
---
 utils/statd/start-statd | 4 ++++
 1 file changed, 4 insertions(+)
utils/statd/start-statd +4 -0
index 19e6eb2..2fd6039 100755
@@ -6,6 +6,10 @@
 # site.
 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 
+# Use flock to serialize the running of this script
+exec 200> /var/run/rpc.statd.lock
+flock -e 200
+
 if [ -s /var/run/rpc.statd.pid ] &&
        [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&
        kill -0 `cat /var/run/rpc.statd.pid` > /dev/null 2>&1