diff --git a/share/hooks/raft/vip.sh b/share/hooks/raft/vip.sh index ff67669c83..d94844ec52 100755 --- a/share/hooks/raft/vip.sh +++ b/share/hooks/raft/vip.sh @@ -86,9 +86,21 @@ function virtualip() { # main # +if [ -z "${ONE_LOCATION}" ]; then + LOCK_LOCATION=/var/lock/one +else + LOCK_LOCATION=$ONE_LOCATION/var/lock +fi + +LOCK_FILE="$LOCK_LOCATION/vip_sh" + ACTION="$1" shift +# Start of critical section (opens LOCK_FILE with fd 56) +exec 56>$LOCK_FILE +flock -w 60 56 + # Process all parameters in the form of interface:IP while [[ $# -gt 0 ]] do