From 9cdb2de3b5f1d08d74a762cfda2ade16692ef9db Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Mon, 28 May 2018 14:09:47 -0500 Subject: [PATCH] WRS. Re-enable background execution of arp commands. Typical ARP commands are taking 6 seconds due to no responses back after 7 attempts. This change allows that delay to be backgrounded --- heartbeat/IPaddr2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2 index 59620d2..86009b9 100755 --- a/heartbeat/IPaddr2 +++ b/heartbeat/IPaddr2 @@ -719,12 +719,13 @@ run_send_arp() { if [ $ARP_COUNT -ne 0 ] ; then ARGS="-i $OCF_RESKEY_arp_interval -c $ARP_COUNT -p $SENDARPPIDFILE -I $NIC -m $MY_MAC $OCF_RESKEY_ip" ocf_log $LOGLEVEL "$SENDARP $ARGS" - output=$($SENDARP $ARGS 2>&1) + if ocf_is_true $OCF_RESKEY_arp_bg; then + ($SENDARP $ARGS || ocf_log err "Could not send gratuitous arps")& >&2 + else + $SENDARP $ARGS || ocf_log err "Could not send gratuitous arps" + fi rc=$? if [ $rc -ne $OCF_SUCCESS ]; then - if ! ocf_is_true $OCF_RESKEY_arp_bg; then - ocf_log err "send_arp output: $output" - fi ocf_exit_reason "Could not send gratuitous arps" exit $OCF_ERR_GENERIC fi -- 1.8.3.1