On 12/12/14 at 03:34pm, Baoquan He wrote:
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
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
Two minor nits inline.
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
@@ -342,7 +342,12 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> /tmp/$$-kdump.conf
- sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+ if [ -n "$(grep ^path "/etc/kdump.conf"| cut -d' '
-f2)" ]; then
I think you can use "get_option_value path" for both here and
where you get $_save_path
+ sed -i -e "s#$_save_path#$_path#"
I think there's a potential bug here. Say user configure kdump.conf
like the following:
Then sed may replace "/var/crash/post.sh" with something else, depanding
on mount point.
I think it's worth to send another patch to fix all sed command with the
exact matching syntax. For example:
sed -i -e "s#^path[[:space:]]\+$_save_path#path $_path#"
+ echo "path $_path" >> /tmp/$$-kdump.conf
kexec mailing list