Hi,
I hit the following issue and wrote this patch, but I found later that
it might be better to fix the dracut nfs/ssh-client modules in this case.
but I'm not familiar with dracut.. could I have any comments?
Thanks,
Kazu
From f39a89d5da01cb5f27ff4b1c8a81d6b58601e80c Mon Sep 17 00:00:00 2001
From: Kazuhito Hagio <k-hagio-ab(a)nec.com>
Subject: [PATCH] Add /etc/hosts to kdump initramfs for nfs/ssh dump
Currently the /etc/hosts file is not contained in kdump initramfs
by default. Hosts that depend only on /etc/hosts to resolve IP
address (i.e. do not have DNS servers) can start kdump service with
hostname nfs/ssh configuration, but fail in resolving the target
server's IP address on the 2nd kernel:
mount[355]: mount.nfs: Failed to resolve server dumpsrv: Name or service not known
...
systemd[1]: kdumproot-dump.mount: Mount process exited, code=exited, status=32/n/a
systemd[1]: kdumproot-dump.mount: Failed with result 'exit-code'.
systemd[1]: Failed to mount /kdumproot/dump.
Add the /etc/hosts file to kdump initramfs when nfs/ssh dump is
configured. The /etc/nsswitch.conf file is also required for ssh
dump according to a test.
Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
---
dracut-module-setup.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 8316589b3ac8..c59750810cf0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -874,6 +874,10 @@ install() {
# nfs/ssh dump will need to get host ip in second kernel and need to call
'ip' tool, see get_host_ip for more detail
if is_nfs_dump_target || is_ssh_dump_target; then
inst "ip"
+ # For hosts that depend only on /etc/hosts to resolve IP address.
+ # /etc/nsswitch.conf is also required for ssh dump.
+ inst "/etc/hosts"
+ inst "/etc/nsswitch.conf"
fi
# For the lvm type target under kdump, in /etc/lvm/lvm.conf we can
--
2.18.4
Show replies by date