diff options
| author | Michele Baldessari <michele@acksyn.org> | 2021-02-28 09:38:32 +0100 |
|---|---|---|
| committer | Bogdan Dobrelya <bogdando@mail.ru> | 2021-06-30 17:27:27 +0200 |
| commit | 4c981497b55bf238a2f7a42c8e377e0787ca3446 (patch) | |
| tree | 1df46a9a995c34ad50a291662997357dd21e5b1f /scripts | |
| parent | 2116b37f5342e1b150f226b59c299544b0d628b3 (diff) | |
| download | rabbitmq-server-git-4c981497b55bf238a2f7a42c8e377e0787ca3446.tar.gz | |
Stop logging unblock client access unconditionally
Currently every call to unblock_client_access() is followed by a log line
showing which function requested the unblocking. When we pass the parameter
OCF_RESKEY_avoid_using_iptables=true it makes no sense to log
unblocking of iptables since it is effectively a no-op.
Let's move that logging inside the unblock_client_access() function
allowing a parameter to log which function called it.
Tested on a cluster with rabbitmq bundles with avoid_using_iptables=true
and observed no spurious logging any longer:
[root@messaging-0 ~]# journalctl |grep 'unblocked access to RMQ port' |wc -l
0
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/rabbitmq-server-ha.ocf | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf index 689c4f074c..27b7ebdb8a 100755 --- a/scripts/rabbitmq-server-ha.ocf +++ b/scripts/rabbitmq-server-ha.ocf @@ -820,6 +820,10 @@ block_client_access() unblock_client_access() { + local lhtext="none" + if [ -z $1 ] ; then + lhtext=$1 + fi # When OCF_RESKEY_avoid_using_iptables is true iptables calls are noops if [ "${OCF_RESKEY_avoid_using_iptables}" == 'true' ] ; then return @@ -829,6 +833,7 @@ unblock_client_access() 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 + ocf_log info "${lhtext} unblocked access to RMQ port" } get_nodes__base(){ @@ -1378,7 +1383,7 @@ start_rmq_server_app() { ocf_log info "${LH} begin." # Safe-unblock the rules, if there are any - unblock_client_access + unblock_client_access "${LH}" # Apply the blocking rule block_client_access rc=$? @@ -1395,8 +1400,7 @@ start_rmq_server_app() { start_beam_process rc=$? if [ $rc -ne $OCF_SUCCESS ]; then - unblock_client_access - ocf_log info "${LH} unblocked access to RMQ port" + unblock_client_access "${LH}" return $OCF_ERR_GENERIC fi fi @@ -1412,8 +1416,7 @@ start_rmq_server_app() { if [ $rc -ne 0 ] ; then ocf_log err "${LH} RMQ-server app can't be stopped. Beam will be killed." kill_rmq_and_remove_pid - unblock_client_access - ocf_log info "${LH} unblocked access to RMQ port" + unblock_client_access "${LH}" return $OCF_ERR_GENERIC fi else @@ -1435,8 +1438,7 @@ start_rmq_server_app() { else ocf_log err "${LH} RMQ-server app can't be stopped during Mnesia cleaning. Beam will be killed." kill_rmq_and_remove_pid - unblock_client_access - ocf_log info "${LH} unblocked access to RMQ port" + unblock_client_access "${LH}" return $OCF_ERR_GENERIC fi fi @@ -1447,8 +1449,7 @@ start_rmq_server_app() { kill_rmq_and_remove_pid fi ocf_log info "${LH} end." - unblock_client_access - ocf_log info "${LH} unblocked access to RMQ port" + unblock_client_access "${LH}" return $rc } |
