From 9be1a1a706c4c132b97d401b1f08bab8383e344f Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Mon, 4 Sep 2017 12:13:16 +0200 Subject: [PATCH] Send both gratuitous ARP request and reply on VIP change. (#426) * Send both gratuitous ARP request and reply on VIP change. * Enable arping in sudoers * Run arping via sudo --- share/hooks/raft/vip.sh | 7 ++++++- share/pkgs/CentOS/opennebula.sudoers | 2 +- share/pkgs/Debian7/opennebula.sudoers | 2 +- share/pkgs/Debian8/opennebula.sudoers | 2 +- share/pkgs/Ubuntu/opennebula.sudoers | 2 +- share/pkgs/openSUSE/opennebula.sudoers | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/share/hooks/raft/vip.sh b/share/hooks/raft/vip.sh index 9925b196c4..ccd365fd08 100755 --- a/share/hooks/raft/vip.sh +++ b/share/hooks/raft/vip.sh @@ -17,7 +17,12 @@ fi case $ACTION in leader) sudo ip address add $IP dev $INTERFACE - arping -c 5 -A -I $INTERFACE ${IP%%/*} + for i in $(seq 5); do + sudo arping -c 1 -U -I $INTERFACE ${IP%%/*} + sleep 1 + sudo arping -c 1 -A -I $INTERFACE ${IP%%/*} + sleep 1 + done ;; follower) diff --git a/share/pkgs/CentOS/opennebula.sudoers b/share/pkgs/CentOS/opennebula.sudoers index b78abe88b5..9e96bfc428 100644 --- a/share/pkgs/CentOS/opennebula.sudoers +++ b/share/pkgs/CentOS/opennebula.sudoers @@ -2,7 +2,7 @@ Defaults:oneadmin !requiretty Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync, /sbin/mkswap -Cmnd_Alias ONE_NET = /usr/sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /usr/sbin/ipset +Cmnd_Alias ONE_NET = /usr/sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /usr/sbin/ipset, /usr/sbin/arping Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange, /sbin/lvscan Cmnd_Alias ONE_ISCSI = /sbin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl diff --git a/share/pkgs/Debian7/opennebula.sudoers b/share/pkgs/Debian7/opennebula.sudoers index 832286454d..e4806a6636 100644 --- a/share/pkgs/Debian7/opennebula.sudoers +++ b/share/pkgs/Debian7/opennebula.sudoers @@ -2,7 +2,7 @@ Defaults:oneadmin !requiretty Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync, /sbin/mkswap -Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset +Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset, /usr/bin/arping Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange, /sbin/lvscan Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl diff --git a/share/pkgs/Debian8/opennebula.sudoers b/share/pkgs/Debian8/opennebula.sudoers index c58aef544c..45348289c1 100644 --- a/share/pkgs/Debian8/opennebula.sudoers +++ b/share/pkgs/Debian8/opennebula.sudoers @@ -2,7 +2,7 @@ Defaults:oneadmin !requiretty Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync, /sbin/mkswap -Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /sbin/ipset +Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /sbin/ipset, /usr/bin/arping Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange, /sbin/lvscan Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl diff --git a/share/pkgs/Ubuntu/opennebula.sudoers b/share/pkgs/Ubuntu/opennebula.sudoers index c58aef544c..45348289c1 100644 --- a/share/pkgs/Ubuntu/opennebula.sudoers +++ b/share/pkgs/Ubuntu/opennebula.sudoers @@ -2,7 +2,7 @@ Defaults:oneadmin !requiretty Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync, /sbin/mkswap -Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /sbin/ipset +Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip6tables, /sbin/ip, /sbin/ipset, /usr/bin/arping Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange, /sbin/lvscan Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl diff --git a/share/pkgs/openSUSE/opennebula.sudoers b/share/pkgs/openSUSE/opennebula.sudoers index d19d98d430..fe5674ab4e 100644 --- a/share/pkgs/openSUSE/opennebula.sudoers +++ b/share/pkgs/openSUSE/opennebula.sudoers @@ -2,7 +2,7 @@ Defaults:oneadmin !requiretty Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin Cmnd_Alias ONE_MISC = /usr/bin/dd, /sbin/mkfs, /usr/bin/sync -Cmnd_Alias ONE_NET = /sbin/brctl, /usr/sbin/ebtables, /usr/sbin/iptables, /usr/sbin/ip6tables, /sbin/ip +Cmnd_Alias ONE_NET = /sbin/brctl, /usr/sbin/ebtables, /usr/sbin/iptables, /usr/sbin/ip6tables, /sbin/ip, /usr/sbin/arping Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange, /sbin/lvscan Cmnd_Alias ONE_ISCSI = /sbin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl