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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxx>
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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux