* [PATCH 1/1] start-statd: Use flock to serialize the running of this script
@ 2016-06-20 16:44 Steve Dickson
2016-06-21 16:09 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2016-06-20 16:44 UTC (permalink / raw)
To: Linux NFS Mailing list
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] start-statd: Use flock to serialize the running of this script
2016-06-20 16:44 [PATCH 1/1] start-statd: Use flock to serialize the running of this script Steve Dickson
@ 2016-06-21 16:09 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2016-06-21 16:09 UTC (permalink / raw)
To: Linux NFS Mailing list
On 06/20/2016 12:44 PM, Steve Dickson wrote:
> 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>
Committed...
steved.
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-21 16:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 16:44 [PATCH 1/1] start-statd: Use flock to serialize the running of this script Steve Dickson
2016-06-21 16:09 ` Steve Dickson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.