Message ID | 1466441099-16166-1-git-send-email-steved@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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 > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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
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(+)