Steve found a bug. When mount a disk in /var and not specify path
in /etc/kdump.conf, the vmcore will be dumped into /var/crash of
that disk, but not /crash on that disk.
This is because when write the parsed path into /tmp/$$-kdump.conf
in default_dump_target_install_conf() of mkdumprd, it uses below
sed command. So if no path specified at all, this sed command won't
add it to /tmp/$$-kdump.conf. Then in 2nd kernel it will take default
path, namely "/var/crash" as path if no path in /etc/kdump.conf in
2nd kernel.
sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
In this patch add a judgement, if user specified path let's use sed
command to replace it with parsed path. Otherwise execute a echo
command to add the path:
echo "path $_path" >> /tmp/$$-kdump.conf
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 9299b5d..19792ea 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -342,7 +342,12 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> /tmp/$$-kdump.conf
_path=${_save_path##"$_mntpoint"}
- sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+
+ if [ -n "$(grep ^path "/etc/kdump.conf"| cut -d' '
-f2)" ]; then
+ sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+ else
+ echo "path $_path" >> /tmp/$$-kdump.conf
+ fi
fi
}
--
1.9.0