summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2016-08-16 10:15:13 +0300
committerGitHub <noreply@github.com>2016-08-16 10:15:13 +0300
commit9d4f0aaa22653130aebc7408729b3164bbe63227 (patch)
tree694de4ece374458283ec0bd44cb33c335e24fbd3
parent15cb69740faf7c3df7ddbf0a6ce593f885f12e10 (diff)
parent6e1d718b0312b472fb658f4e9b0dac69cb2794be (diff)
downloadrabbitmq-server-git-9d4f0aaa22653130aebc7408729b3164bbe63227.tar.gz
Merge pull request #920 from mwhahaha/iptables-stable
Update iptables calls with --wait
-rwxr-xr-xscripts/rabbitmq-server-ha.ocf8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf
index cd07d0c1b0..9e07dc8490 100755
--- a/scripts/rabbitmq-server-ha.ocf
+++ b/scripts/rabbitmq-server-ha.ocf
@@ -691,9 +691,9 @@ block_client_access()
# do not add temporary RMQ blocking rule, if it is already exist
# otherwise, try to add a blocking rule with max of 5 retries
local tries=5
- until $(iptables -nvL | grep -q 'temporary RMQ block') || [ $tries -eq 0 ]; do
+ until $(iptables -nvL --wait | grep -q 'temporary RMQ block') || [ $tries -eq 0 ]; do
tries=$((tries-1))
- iptables -I INPUT -p tcp -m tcp --dport ${OCF_RESKEY_node_port} -m state --state NEW,RELATED,ESTABLISHED \
+ iptables --wait -I INPUT -p tcp -m tcp --dport ${OCF_RESKEY_node_port} -m state --state NEW,RELATED,ESTABLISHED \
-m comment --comment 'temporary RMQ block' -j REJECT --reject-with tcp-reset
sleep 1
done
@@ -707,8 +707,8 @@ block_client_access()
unblock_client_access()
{
# remove all temporary RMQ blocking rules, if there are more than one exist
- for i in $(iptables -nvL --line-numbers | awk '/temporary RMQ block/ {print $1}'); do
- iptables -D INPUT -p tcp -m tcp --dport ${OCF_RESKEY_node_port} -m state --state NEW,RELATED,ESTABLISHED \
+ for i in $(iptables -nvL --wait --line-numbers | awk '/temporary RMQ block/ {print $1}'); do
+ iptables --wait -D INPUT -p tcp -m tcp --dport ${OCF_RESKEY_node_port} -m state --state NEW,RELATED,ESTABLISHED \
-m comment --comment 'temporary RMQ block' -j REJECT --reject-with tcp-reset
done
}