Commit Graph

440 Commits

Author SHA1 Message Date
Baoquan He c8ce08763f kdumpctl:print out the service status
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>
2013-02-27 11:20:18 +08:00
Baoquan He dd02c559ae Remove useless codes related to LOGGER in kdumpctl
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>
2013-02-27 11:19:52 +08:00
dyoung@redhat.com e074e3952b tune sysconfig to save memory usage
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>
2013-02-27 10:16:14 +08:00
Baoquan He 71d27e8b17 Release 2.0.3.67 2013-02-19 17:33:11 +08:00
Baoquan He c5052f6512 pull makedumpfile 1.5.3 2013-02-19 17:33:03 +08:00
Baoquan He 2cc052a071 Revert: Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME
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.
2013-02-19 15:02:52 +08:00
Baoquan He 01bb9af7ed Rectify the get_host_ip implementation
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>
2013-02-19 14:27:39 +08:00
Baoquan He c64f56348c Modify codes related to dump dir to make it clearer
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>
2013-02-19 14:22:04 +08:00
Baoquan He 8777b97020 Revert: Revert: Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME
This reverts commit 11261a5bca.

Because failed to compile makedumpfile v1.5.2 on ppc64. Reverting
this revert is necessary.
2013-02-16 18:14:57 +08:00
Baoquan He a431cab7ee Revert: Release 2.0.3-67
Because failed to compile makedumpfile v1.5.2 on ppc64, revert this
release.
2013-02-16 18:06:40 +08:00
Baoquan He 80ba39086a Release 2.0.3-67
makedumpfile v1.5.2
2013-02-16 17:37:53 +08:00
Baoquan He 11261a5bca Revert: Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME
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.
2013-02-16 17:20:54 +08:00
Baoquan He 42b0a0bb46 Remove comma which is redundant
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>
2013-02-16 15:19:41 +08:00
Dave Young 1a882465f8 Release 2.0.3-66 2013-02-05 10:36:50 +08:00
Dave Young 05b67ee95c Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME 2013-02-01 14:39:56 +08:00
WANG Chao 0f07159657 kexec-tools.spec: remove kdump image when a corresponding kernel is removed.
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>
2013-01-28 14:27:54 +08:00
Dave Young e9e10df925 Release 2.0.3-65 2013-01-28 14:15:00 +08:00
Cong Wang 97e107b5ab Add support for team devices
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>
2013-01-28 14:04:27 +08:00
Dave Young 2c5d631e7d Update translation file po/it.po 2013-01-28 14:02:09 +08:00
Dave Young 5325594fca remove wait for net ok function
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>
2013-01-28 14:01:05 +08:00
Dave Young ae1db90332 add bootdev cmdline param
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>
2013-01-28 14:00:58 +08:00
Dave Young 4874a9539a kdumpnic cmdline file name cleanup
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>
2013-01-28 14:00:54 +08:00
Dave Young 009b983103 Release 2.0.3-64 2013-01-04 14:14:16 +08:00
Dave Young b865438443 Pull patch kexec-tools-2.0.3-ppc-exec-stack-fix.patch
fix issue of exec on stack for ppc32
2012-12-21 15:19:55 +08:00
Dave Young 440fc959ee Release 2.0.3-63 2012-12-21 11:37:01 +08:00
Dave Young 8770ac2d6f revert explictly handling of PIPESTATUS
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>
2012-12-21 11:33:30 +08:00
Dave Young e36d4ab60d enable pipefail bash option
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>
2012-12-21 11:33:07 +08:00
WANG Chao 8fddece4e9 wrong ssh key fix
To get sshkey from kdump.conf we should filter out comment.
Fix it by change awk pattern to use ^sshkey

Acked-by: Baoquan He <bhe@redhat.com>
2012-12-21 11:32:31 +08:00
Dave Young c53d3d2a10 Update sources 2012-12-21 11:17:17 +08:00
Dave Young 9e81dab151 Update 3 po files:
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"
2012-12-21 11:14:47 +08:00
Dave Young f9171d8a4d Release 2.0.3-62 2012-12-21 10:45:32 +08:00
Dave Young f31de732e6 Update sources 2012-12-21 10:45:07 +08:00
Dave Young 28df2c1f6f Pull translated po files from zanata 2012-12-21 10:39:52 +08:00
Baoquan He 4590f6e33b Optimize redundent code fetching server of network dump
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>
2012-12-14 17:23:46 +08:00
Baoquan He 3be6c1228e change the dump dir format to be more readable
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>
2012-12-14 17:23:09 +08:00
Dave Young 3f0ba9aab7 Release 2.0.3-61 2012-12-12 17:17:07 +08:00
Dave Young 22dcf44cf4 firstboot:fix reserve mem ui spinbox step size
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>
2012-12-12 17:15:10 +08:00
Dave Young f21cbb5165 handle readonly mounted filesystem
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>
2012-12-12 17:13:54 +08:00
Dave Young b30fee648c Release 2.0.3-60 2012-12-10 13:56:44 +08:00
Dave Young 58ac6739fa Update sources 2012-12-10 13:53:55 +08:00
Dave Young 7635d4f5db makedumpfile 1.5.1 2012-12-10 13:43:00 +08:00
Dave Young 53ee0e93a5 Update po tar.gz 2012-12-05 01:33:49 -05:00
Dave Young d0e268c1ae Add a notes for zanata process 2012-12-05 01:23:09 -05:00
Dave Young 5ae99122af Add two xmls file for po zanata translation
pom.xml for maven client
zanata.xml for kexec-tools zanata project
2012-12-05 01:19:12 -05:00
Dave Young 7f92db4f60 Cleanup and recreate po files
Resolves: bz859783

Old po/ folder are not well maintained. All po files are just
same as the outdated pot file.

Translating team need kexec-tools to update it to
the conventional mode so it become available for translating.

Currently old translated po files are not maintained in git.
Instead it's a kexec-tools-po.tar.gz in dist git server.
see kexec-tools.spec: Source13. This patch will maintain them
in po/ and update the contents from lastest source code.

The refresh include below items:
1. update pot file from latest source code.
2. merge old translated po files with the new pot file
3. maintain translated po files in po/ folder
Also updated the Makefile to make the process more easier.

Usage after the update is like below:
a) simple `make` will generate the mo files for installation
b) `make install` will install mo files to locale directory
Above two command are used in rpm spec to install mo files

c) `make merge` will update pot file from source code and merge
translated po files with latest pot file. So it become ready for
translation team to translate

For kexec-tools maintaining, what we need to do is:
Once firstboot_kdump.py is modifed, we should run `make merge`
to update the po files for translation
After po files get translated they need to be copied to po/
and commit to git. Then create a kexec-tools-po.tar.gz and
upload the tar.gz to dist git, also update the checksum in spec
file.
2012-11-30 17:34:16 +08:00
Dave Young 3b4929edb3 Release 2.0.3-58 2012-11-16 14:20:12 +08:00
dyoung@redhat.com 2c20a30420 Enable kdump service after installation
Kdump systemd service should be enabled after installation like what
we do for old sysv init service.

systemctl enable will do daemon-reload automaticlly, so no need to
reload the daemon again. Please see manpage of systemctl about the detail.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-11-16 14:17:06 +08:00
dyoung@redhat.com c616b97dfb get MEM_RESERVED from sysfs attribute
Resolves: bz866357

MEM_RESERVED is for checking if crash memory is reserved or not.
Originally it use /proc/iomem for x86, parsing /proc/cmdline for ppc.
This cause problems for crashkernel=auto, because it does not fit for
the regular expression of [0-9]\+[MmKkGg]@[0-9]\+[MmGgKk]

Fix this by use /sys/kernel/kexec_crash_size for all arches.
After the fix the code is more clear than before.

[v1->v2] vivek: add space between "crash kernel"; remove misleading warning.

Tested-by: Chao Wang <chaowang@redhat.com>
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-11-16 14:14:35 +08:00
dyoung@redhat.com 4d9bb7face get_ssh_size: use -n to redirect stdin from /dev/null
Resolves: bug 868990

ssh will send local stdin input to remote side, this cause trouble
when we call ssh in the loop of parsing kdump.conf.

Ie. if we specify both 'ssh' and 'core_collector' option in kdump.conf,
and put 'core_collector' behind 'ssh', there will be no chance to
handle 'core_collector' because in get_ssh_size() ssh eat all the later
input of the while loop.

Fix this by use /dev/null as stdin in get_ssh_size().

Tested in fedora kvm guest.

Signed-off-by: Dave Young <dyoung@redhat.com>
Suggested-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-11-16 14:13:27 +08:00
Dave Young c5c4a7b8b0 add random feeding code for ssh dump
ssh: add random feeding code

openssh usually depends on /dev/urandom to seeding PRNG (pseudo-random number
generator). To ensure there's sufficient entropy just feed /dev/urandom with
saved /var/lib/random-seed which is saved in installing phase.

dracut_install will print error message, so just exit and do not print error
again.

Todo: other dracut_install fail and exit, such as dd, makedumpfile.

[v2->v3]: use [[:blank:]] for whitespace checking.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-11-16 14:07:52 +08:00