linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/1] start-statd: Use flock to serialize the running of this script
Date: Mon, 20 Jun 2016 12:44:59 -0400	[thread overview]
Message-ID: <1466441099-16166-1-git-send-email-steved@redhat.com> (raw)

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

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/statd/start-statd | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 19e6eb2..2fd6039 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -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
-- 
2.5.5


             reply	other threads:[~2016-06-20 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 16:44 Steve Dickson [this message]
2016-06-21 16:09 ` [PATCH 1/1] start-statd: Use flock to serialize the running of this script Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466441099-16166-1-git-send-email-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).