blkid do not support UUID/LABEL with quotes, remove the quotes before converting
to dev name, or the result devname will be nul.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Add a function check_config to check kdump config file.
1. move multi dump target checking into this function
2. check invalid config options and obsolete config options
3. check null config value.
[v2->v3]: add detail doc about deprecated options in kdump.conf manpage.
[v3->v4]: print out the bad config option in case it is not valid.
[v4->v5]: improve documentation according to comments from Vivek.
[v5->v6]: s/Deprecated/Invalid for invalid config options.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Marc Milgram <mmilgram@redhat.com>
check_config is actually checking the files timestamp and rebuilding initrd.
Rename it to check_rebuild instead thus check_config can be used for checking
config file valid or not.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Moving the checking target mount code a little earlier to ensure
dump target is mounted and fail out early before other handlings.
This change also cleanup a bit for the related code.
Tested UUID/devname local dump, also tested the non-exist kdump target.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Previously to_dev_name use blkid to get dev name from dump target,
but blkid can not handle UUID/LABEL with quotes so to_dev_name will
silently fail.
Because we enforce dump target being mounted before creating kdump
initrd, so change to use findmnt is fine. findmnt can handle input
params with quotes.
to_dev_name is not necessary anymore, just remove it.
Also there's another user of it is for checking if the dev is root
or not, here change to use findmnt for this as well.
Tested the rootfs dump, UUID with/without quotes dump.
Signed-off-by: Dave Young <dyoung@redhat.com>
Reviewed-by: Caspar Zhang <czhang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
In old code, kdumpctl program exit directly when check_ssh_target failed
without printing "Starting kdump: FAILED". Then when manually invoke
"kdumpctl restart", only print "Stopping kdump: OK", but no "Starting
kdump: FAILED". That is unreasonable.
In this patch change check_ssh_target() to return when it failed. Then
check the returned value in start() function and print status if the
returned value is not 0.
Meanwhile change "space" to "tab" in function check_ssh_target(), make
those be consistent with the whole script file.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
In kdumpctl, some printings are incomplete, like "Starting kdump:" or
"Stopping kdump:". Now add the service status to the end of such kind
of printing.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
In fedora, systemd take control of services. During bootup and manually
invoke "systemctl restart kdump.service", the standard Output/Error
are all redirected to journal/syslog. Then particular LOGGER is useless
in kdumpctl.
In this patch, remove codes related to LOGGER. But for noticing user,
trying to add substituted printing to Standard Output/Err.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
tune sysconfig to save 2nd kernel memory usage
The memory in 2nd kernel is limited, we need to use as less memory as we can
to ensure vmcore capturing ok.
I'm doing below improvements in this patch:
1)
numa support is not necessary for kdump kernel, so disable it by adding numa=off
to save some kernel mm memory usage.
2)
Also add udev.children-max=2 to cmdline to limit max udev chidren processes.
3)
For ppc64, ehea driver will by default enable multi queue feature which will
use a lot of memory. Almost each ppc machine will oom for network(ssh/nfs)
kdump. The module param use_mcs=0 is used to disable multi queue feature.
Tested these params on an IBM machine with 2 numa nodes which ooms even for
local dump to rootfs.
With this patch oom does not happen for local/ssh dump, but for nfs dump oom
still happens in the middle of makedumpfile vmcore copying. So there should be
other improvement yet.
For ehea driver there's other params we can use, but because it's hard to
measure the saved memory, I'm waiting for input from IBM people. We can add
them later.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
This reverts commit 05b67ee95c.
The old commit was merged for a emergent bug fixing on release 1.5.1
of makedumpfile. Now the upstream has been updated to v1.5.3, and this
patch has been included already.
For updating to makedumpfile v1.5.3, revert it.
In previous implementation of get_host_ip, global variable HOST_IP
is used to be a intermediate variable. In this case, if finally
failed to get HOST_IP, the original default value is also overwritten.
It's buggy.
Eg. in ssh case, when faied to get host ip, the default local host ip
"127.0.0.1" is lost too. that's not expected.
Change it by adding a local variable as intermediate variable.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
In previous patch, get_host_ip was introduced to make the dump dir
more readable and back compatible with rhel6. But the implementation
is not good, making variable DATEDIR ambiguous. In this patch, modify
those codes to make it clearer.
About code checking returned value of get_host_ip, if not zero the
function do_default_action is called. That looks buggy, it will
continue going through the later code flow. Add FINAL_ACTION after
invoking do_default_action.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This reverts commit 05b67ee95c.
The old commit was merged for a emergent bug fixing on release 1.5.1
of makedumpfile. Now the upstream has been updated to v1.5.2, and this
patch has been included already.
For updating to makedumpfile v1.5.2, revert it.
In man page, the removed comma is unnecessary, remove it in this page.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Current kdump image name prefix has changed from initrd to initramfs.
Tested on a vm running Fedora 18.
Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
V4: Sync with the latest teamd
V3: Drop patch 2/2 which harms readability
Move inst_dir to kdump_setup_team()
Avoid saying why teamdctl fails
Error out for vlan over team, like bridge
Remove the useless exit in kdump_get_perm_addr()
V2: remove the tmp config file in /tmp
split the non-team part
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=874025
(This BZ is against RHEL7 though...)
Depends on dracut patch:
http://article.gmane.org/gmane.linux.kernel.initramfs/3043
and depends on latest version of teamd.
This patch adds support for team devices on kdump side.
I tested team active-backup mode and round-robin mode,
vmcore can be dumped over ssh successfully.
Note, currently we don't support stacked devices
on/under team, it is tricky and can be added on request.
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
After recent dracut network changes, waiting for nic ready stuff is handled
in cmdline hooks when generate udev rules. So wait_for_net_ok is not
necessary any more in kdump.sh, Removing the code here.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
With recent dracut a bootdev is needed in cmdline, so dracut can waiting for
this nic ready early in initqueue. So in this patch bootdev=${_netnic} is added
[v1->v2]: use standard cmdline file name 70bootdev.conf
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
use standard cmdline file name start with digit number: 60kdumpnic.conf
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
To simplify the code logic, remove the previous PIPESTATUS handling because
previous patch "enable pipefail bash option" added pipefail option which will
also resolve this issue.
This is a reverting of below commit:
commit 3111ff74c9
Author: Chao Wang <chaowang@redhat.com>
Date: Mon Aug 6 14:49:52 2012 +0800
Change return value to indicate the result of dump_raw() correctly.
Resolves bz845916.
For raw dump code below:
$CORE_COLLECTOR /proc/vmcore | dd of=$1 bs=$DD_BLKSIZE >> /tmp/dd_progress_f
in case pipe fails it will still return 0, Fix this by return the PIPESTATUS
Signed-off-by: Chao Wang <chaowang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Follwing code will not return 1 if CORE_COLLECTOR /proc/vmcore fail:
$CORE_COLLECTOR /proc/vmcore | ssh $_opt $2 "dd bs=512 of=$_dir/vmcore-incomplete" || return 1
Fix it by enabling pipefail option
Tested in F18 with ssh dump.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
po/gu.po
po/or.po
po/zh_CN.po
These translations missed one '\n' so build fails with:
msgfmt --statistics --verbose -o gu.mo gu.po
gu.po:73: `msgid' and `msgstr' entries do not both begin with '\n'
Fix them by adding one more "\n"
Code in function kdump_install_net used to get server of network dump
is is a little redundent, can be optimized into one line. For nfs/ssh,
this line of code is enough.
Test passed on local kvm guest with Fedora 18.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Resolves: bz880551
Currently on fedora directory name of kdump is like 14.11.12-03:40:30.
It's not as readable as RHEL6. The old format of dir is host_ip-date-time.
This patch changes it back like ole one as below.
192.168.122.234-2012-10-31-05:17:20
If can't get HOST_IP for a network kudmp, we just fail. Becasue most
likely any attempt to save dump will also fail.
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Currently the gtk spinbox use 64M as the spin step size, this means user
can only reserve memsize round down to 64M. But in fact user can simply
input the value which is not aligned to step size in the text entry. Also
user can use any value from kernel boot cmdline. Thus it will cause problem:
For example, booting with crashkernel=138M, firstboot spinbox will round down
it to 128M, and show 128M in spinbox value, but actualy reserved label will
show 138M, they are not consistent and confusing.
We have lowerBound value which is 128M, there's no reason to limit the increase
step as 64M, fix this by changeing the step to 1M.
Tested with fedora 18 for different values.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
We need fs dump target being mounted firstly before creating mkdumprd
This is because we want to get the mount options from kernel mountinfo
instead of simply mount it without considering mount options.
To avoid the filesystem being used by something other than kdump we
suggest them to mount it as 'ro', mkdumprd will remount it as 'rw' when
necessary and remount it back to 'ro'
In 2nd kernel kdump will still use 'rw' to mount it though.
Tested local read-only mounted fs dump.
[v1->v2]: improve documentation
add error handling for `mount -o remount,ro`
Fixed the changelog per Vivek's comment
The code was reviewed by Vivek.
Signed-off-by: Dave Young <dyoung@redhat.com>