Hi Pingfan,
On Mon, Jul 29, 2019 at 4:15 PM Pingfan Liu <piliu(a)redhat.com> wrote:
The current code only exclude the hostname, while localhost can have alias in
/etc/hosts. All of the alias should be excluded from the fence dump node to
avoid deadlock issue.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
dracut-module-setup.sh | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 27b9f02..d96f8b0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -689,6 +689,21 @@ kdump_check_iscsi_targets () {
}
}
+is_localhost() {
+ local hostnames=$(hostname -A)
+ local shortnames=$(hostname -A -s)
+ local nodename=$1
+
+ hostnames="$hostnames $shortnames)
Should it be hostnames="$hostnames $shortnames" ?
+
+ for name in ${hostnames}; do
+ if [ "$name" == "$nodename" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
# retrieves fence_kdump nodes from Pacemaker cluster configuration
get_pcs_fence_kdump_nodes() {
local nodes
@@ -703,7 +718,7 @@ get_pcs_fence_kdump_nodes() {
eval $node
nodename=$uname
# Skip its own node name
- if [ "$nodename" = `hostname` -o "$nodename" = `hostname -s`
]; then
+ if is_localhost $nodename; then
continue
fi
nodes="$nodes $nodename"
--
2.20.1
Rest of the patch looks good.
--
Best Regards,
Kairui Song