mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
* This should fix issues in HA environment, where we sometimes get duplicated virtual IPs (cherry picked from commit 5788a2528eb30bb576950b403c306557d001fd5e) (cherry picked from commit bf628dc9b64f60cde65fbf8032073ec10de76362)
This commit is contained in:
parent
3b7f9fd164
commit
546d7ae4a7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user