[PATCH] ssh dump: install random-seed from a new location
by WANG Chao
In ssh dump, we use random-seed to feed /dev/urandom. In later release
of systemd[1], random-seed is moved from /var/lib/random-seed to
/var/lib/systemd/random-seed. We need to adapt the change and also keep
backward compatibility with older systemd.
[1]: http://cgit.freedesktop.org/systemd/systemd/commit/?id=ef5bfcf668e6029faa...
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-kdump.sh | 7 ++++++-
dracut-module-setup.sh | 3 ++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 4d8616f..a7672e1 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -146,7 +146,12 @@ dump_ssh()
echo "kdump: saving to $_host:$_dir"
- cat /var/lib/random-seed > /dev/urandom
+ if [ -f /var/lib/random-seed ]; then
+ cat /var/lib/random-seed > /dev/urandom
+ elif [ -f /var/lib/systemd/random-seed ]; then
+ cat /var/lib/systemd/random-seed > /dev/urandom
+ fi
+
ssh -q $_opt $_host mkdir -p $_dir || return 1
save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" $_host
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c013430..96009f8 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -398,7 +398,8 @@ install() {
>"$initdir/lib/dracut/no-emergency-shell"
if is_ssh_dump_target; then
- dracut_install /var/lib/random-seed || exit $?
+ dracut_install -o /var/lib/random-seed || exit $?
+ dracut_install -o /var/lib/systemd/random-seed || exit $?
fi
dracut_install -o /etc/adjtime /etc/localtime
inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress"
--
1.8.4.2
9 years, 8 months
[PATCH] ssh: use ssh -n to redirect stdin from /dev/null
by WANG Chao
When we're parsing kdump.conf, we read it from stdin in a while
loop statement. If we don't use ssh -n within the loop, all rest of the
kdump.conf options, which are in stdin, will be eaten by ssh.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
mkdumprd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index 6de1755..43a41cb 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -153,7 +153,7 @@ mkdir_save_path_ssh()
{
local _opt _dir
_opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- ssh -q $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
+ ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
_ret=$?
if [ $_ret -ne 0 ]; then
perror_exit "mkdir failed on $DUMP_TARGET:$SAVE_PATH"
@@ -165,7 +165,7 @@ mkdir_save_path_ssh()
if [ $_ret -ne 0 ]; then
perror_exit "Could not create temporary directory on $DUMP_TARGET:$SAVE_PATH. Make sure user has write permission on destination"
fi
- ssh -q $_opt $1 rmdir $_dir
+ ssh -qn $_opt $1 rmdir $_dir
return 0
}
--
1.8.4.2
9 years, 8 months
[PATCH] fix kdump dump to nfs fails when configuring nfs dump with hostname
by Arthur Zou
Description of problem:
Kdump can dump the vmcore to remote nfs target if kdump was
configred by using nfs dump and nfs target was mounted before
building kdump initramfs. But if we use hostname to configure
nfs dump, Though the kdump service will start successfully, dump
will fail because there isn't a /etc/hosts file in initramfs.
Resolution:
copy /etc/hosts to initramfs.
Signed-off-by: arthur <zzou(a)redhat.com>
---
mkdumprd | 1 +
1 file changed, 1 insertion(+)
diff --git a/mkdumprd b/mkdumprd
index 6de1755..d18882a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -520,6 +520,7 @@ do
if [ "$config_opt" = "nfs" ]; then
add_dracut_module "nfs"
+ add_dracut_arg "--install" "/etc/hosts"
fi
add_mount "$config_val"
mkdir_save_path_fs $config_val
--
1.8.4.2
9 years, 9 months
[PATCH v2] makedumpfile compression method default to lzo
by WANG Chao
Lzo is proven faster than zlib, for large memory machine it will
extremely shorten the time for saving vmcore. Let's switch to lzo as the
default compression method for makedumpfile.
The drawback is lzo has a little less compression ratio than zlib. But
considering for most users, speed/time is a more serious concern than
vmcore size. So I think default to lzo will benefit most of the users.
v1->v2: update kdump.conf.5 [DaveY]
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-kdump.sh | 2 +-
kdump.conf | 6 +++---
kdump.conf.5 | 16 ++++++++--------
kexec-kdump-howto.txt | 18 +++++++++---------
4 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index d157cd1..4d8616f 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -11,7 +11,7 @@ fi
set -o pipefail
KDUMP_PATH="/var/crash"
CORE_COLLECTOR=""
-DEFAULT_CORE_COLLECTOR="makedumpfile -c --message-level 1 -d 31"
+DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
DEFAULT_ACTION="reboot -f"
DATEDIR=`date +%Y.%m.%d-%T`
diff --git a/kdump.conf b/kdump.conf
index c5cfb4a..3c411fb 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -50,9 +50,9 @@
# automatically be populated with a config file
# appropriate for the running kernel.
# Default core_collector for raw/ssh dump is:
-# "makedumpfile -F -c --message-level 1 -d 31".
+# "makedumpfile -F -l --message-level 1 -d 31".
# Default core_collector for other targets is:
-# "makedumpfile -c --message-level 1 -d 31".
+# "makedumpfile -l --message-level 1 -d 31".
# For core_collector format details please refer to
# kexec-kdump-howto.txt or kdump.conf manpage.
#
@@ -132,7 +132,7 @@
#ssh user(a)my.server.com
#sshkey /root/.ssh/kdump_id_rsa
path /var/crash
-#core_collector makedumpfile -c --message-level 1 -d 31
+#core_collector makedumpfile -l --message-level 1 -d 31
#core_collector scp
#kdump_post /var/crash/scripts/kdump-post.sh
#kdump_pre /var/crash/scripts/kdump-pre.sh
diff --git a/kdump.conf.5 b/kdump.conf.5
index 6f88370..7eaf9dd 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -78,9 +78,9 @@ for the running kernel.
.PP
Note 1: About default core collector:
Default core_collector for raw/ssh dump is:
-"makedumpfile -F -c --message-level 1 -d 31".
+"makedumpfile -F -l --message-level 1 -d 31".
Default core_collector for other targets is:
-"makedumpfile -c --message-level 1 -d 31".
+"makedumpfile -l --message-level 1 -d 31".
Even if core_collector option is commented out in kdump.conf, makedumpfile
is default core collector and kdump uses it internally.
If one does not want makedumpfile as default core_collector, then they
@@ -253,11 +253,11 @@ Above will effectively be translated to:
cp --sparse=always /proc/vmcore <dest-path>/vmcore
.TP
ex2.
-core_collector "makedumpfile -c --message-level 1 -d 31"
+core_collector "makedumpfile -l --message-level 1 -d 31"
Above will effectively be translated to:
-makedumpfile -c --message-level 1 -d 31 /proc/vmcore <dest-path>/vmcore
+makedumpfile -l --message-level 1 -d 31 /proc/vmcore <dest-path>/vmcore
.PP
For dump targets like raw and ssh, in general, core collector should expect
one argument (source file) and should output the processed core on standard
@@ -274,11 +274,11 @@ Above will effectively be translated to.
cat /proc/vmcore | dd of=<target-device>
.TP
ex4.
-core_collector "makedumpfile -F -c --message-level 1 -d 31"
+core_collector "makedumpfile -F -l --message-level 1 -d 31"
Above will effectively be translated to.
-makedumpfile -F -c --message-level 1 -d 31 | dd of=<target-device>
+makedumpfile -F -l --message-level 1 -d 31 | dd of=<target-device>
.PP
ssh dumps examples
.TP
@@ -290,11 +290,11 @@ Above will effectively be translated to.
cat /proc/vmcore | ssh <options> <remote-location> "dd of=path/vmcore"
.TP
ex6.
-core_collector "makedumpfile -F -c --message-level 1 -d 31"
+core_collector "makedumpfile -F -l --message-level 1 -d 31"
Above will effectively be translated to.
-makedumpfile -F -c --message-level 1 -d 31 | ssh <options> <remote-location> "dd of=path/vmcore"
+makedumpfile -F -l --message-level 1 -d 31 | ssh <options> <remote-location> "dd of=path/vmcore"
There is one exception to standard output rule for ssh dumps. And that is
scp. As scp can handle ssh destinations for file transfers, one can
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index d70781b..7ffeab9 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -438,7 +438,7 @@ is a dump filtering and compression utility provided with kexec-tools. On
some architectures, it can drastically reduce the size of your vmcore files,
which becomes very useful on systems with large amounts of memory.
-A typical setup is 'core_collector makedumpfile -F -c --message-level 1 -d 31',
+A typical setup is 'core_collector makedumpfile -F -l --message-level 1 -d 31',
but check the output of '/sbin/makedumpfile --help' for a list of all available
options (-i and -g don't need to be specified, they're automatically taken care
of). Note that use of makedumpfile requires that the kernel-debuginfo package
@@ -458,11 +458,11 @@ cp --sparse=always /proc/vmcore <dest-path>/vmcore
ex2.
---
-core_collector "makedumpfile -c --message-level 1 -d 31"
+core_collector "makedumpfile -l --message-level 1 -d 31"
Above will effectively be translated to:
-makedumpfile -c --message-level 1 -d 31 /proc/vmcore <dest-path>/vmcore
+makedumpfile -l --message-level 1 -d 31 /proc/vmcore <dest-path>/vmcore
For dump targets like raw and ssh, in general, core collector should expect
@@ -482,11 +482,11 @@ cat /proc/vmcore | dd of=<target-device>
ex4.
---
-core_collector "makedumpfile -F -c --message-level 1 -d 31"
+core_collector "makedumpfile -F -l --message-level 1 -d 31"
Above will effectively be translated to.
-makedumpfile -F -c --message-level 1 -d 31 | dd of=<target-device>
+makedumpfile -F -l --message-level 1 -d 31 | dd of=<target-device>
ssh dumps core_collector examples:
---------
@@ -500,11 +500,11 @@ cat /proc/vmcore | ssh <options> <remote-location> "dd of=path/vmcore"
ex6.
---
-core_collector "makedumpfile -F -c --message-level 1 -d 31"
+core_collector "makedumpfile -F -l --message-level 1 -d 31"
Above will effectively be translated to.
-makedumpfile -F -c --message-level 1 -d 31 | ssh <options> <remote-location> "dd of=path/vmcore"
+makedumpfile -F -l --message-level 1 -d 31 | ssh <options> <remote-location> "dd of=path/vmcore"
There is one exception to standard output rule for ssh dumps. And that is
scp. As scp can handle ssh destinations for file transfers, one can
@@ -521,9 +521,9 @@ scp /proc/vmcore <user@host>:path/vmcore
About default core collector
----------------------------
Default core_collector for ssh/raw dump is:
-"makedumpfile -F -c --message-level 1 -d 31".
+"makedumpfile -F -l --message-level 1 -d 31".
Default core_collector for other targets is:
-"makedumpfile -c --message-level 1 -d 31".
+"makedumpfile -l --message-level 1 -d 31".
Even if core_collector option is commented out in kdump.conf, makedumpfile
is default core collector and kdump uses it internally.
--
1.8.4.2
9 years, 9 months
[PATCH] makedumpfile compression method default to lzo
by WANG Chao
Lzo is proven faster than zlib, for large memory machine it will
extremely shorten the time for saving vmcore. Let's switch to lzo as the
default compression method for makedumpfile.
The drawback is lzo has a little less compression ratio than zlib. But
considering for most users, speed/time is a more serious concern than
vmcore size. So I think default to lzo will benefit most of the users.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-kdump.sh | 2 +-
kdump.conf | 6 +++---
kexec-kdump-howto.txt | 18 +++++++++---------
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index f38891d..14843f3 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -11,7 +11,7 @@ fi
set -o pipefail
KDUMP_PATH="/var/crash"
CORE_COLLECTOR=""
-DEFAULT_CORE_COLLECTOR="makedumpfile -c --message-level 1 -d 31"
+DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
DEFAULT_ACTION="reboot -f"
DATEDIR=`date +%Y.%m.%d-%T`
diff --git a/kdump.conf b/kdump.conf
index a0f086a..1bc3064 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -50,9 +50,9 @@
# automatically be populated with a config file
# appropriate for the running kernel.
# Default core_collector for raw/ssh dump is:
-# "makedumpfile -F -c --message-level 1 -d 31".
+# "makedumpfile -F -l --message-level 1 -d 31".
# Default core_collector for other targets is:
-# "makedumpfile -c --message-level 1 -d 31".
+# "makedumpfile -l --message-level 1 -d 31".
# For core_collector format details please refer to
# kexec-kdump-howto.txt or kdump.conf manpage.
#
@@ -136,7 +136,7 @@
#ssh user(a)my.server.com
#sshkey /root/.ssh/kdump_id_rsa
path /var/crash
-#core_collector makedumpfile -c --message-level 1 -d 31
+#core_collector makedumpfile -l --message-level 1 -d 31
#core_collector scp
#kdump_post /var/crash/scripts/kdump-post.sh
#kdump_pre /var/crash/scripts/kdump-pre.sh
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index d70781b..7ffeab9 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -438,7 +438,7 @@ is a dump filtering and compression utility provided with kexec-tools. On
some architectures, it can drastically reduce the size of your vmcore files,
which becomes very useful on systems with large amounts of memory.
-A typical setup is 'core_collector makedumpfile -F -c --message-level 1 -d 31',
+A typical setup is 'core_collector makedumpfile -F -l --message-level 1 -d 31',
but check the output of '/sbin/makedumpfile --help' for a list of all available
options (-i and -g don't need to be specified, they're automatically taken care
of). Note that use of makedumpfile requires that the kernel-debuginfo package
@@ -458,11 +458,11 @@ cp --sparse=always /proc/vmcore <dest-path>/vmcore
ex2.
---
-core_collector "makedumpfile -c --message-level 1 -d 31"
+core_collector "makedumpfile -l --message-level 1 -d 31"
Above will effectively be translated to:
-makedumpfile -c --message-level 1 -d 31 /proc/vmcore <dest-path>/vmcore
+makedumpfile -l --message-level 1 -d 31 /proc/vmcore <dest-path>/vmcore
For dump targets like raw and ssh, in general, core collector should expect
@@ -482,11 +482,11 @@ cat /proc/vmcore | dd of=<target-device>
ex4.
---
-core_collector "makedumpfile -F -c --message-level 1 -d 31"
+core_collector "makedumpfile -F -l --message-level 1 -d 31"
Above will effectively be translated to.
-makedumpfile -F -c --message-level 1 -d 31 | dd of=<target-device>
+makedumpfile -F -l --message-level 1 -d 31 | dd of=<target-device>
ssh dumps core_collector examples:
---------
@@ -500,11 +500,11 @@ cat /proc/vmcore | ssh <options> <remote-location> "dd of=path/vmcore"
ex6.
---
-core_collector "makedumpfile -F -c --message-level 1 -d 31"
+core_collector "makedumpfile -F -l --message-level 1 -d 31"
Above will effectively be translated to.
-makedumpfile -F -c --message-level 1 -d 31 | ssh <options> <remote-location> "dd of=path/vmcore"
+makedumpfile -F -l --message-level 1 -d 31 | ssh <options> <remote-location> "dd of=path/vmcore"
There is one exception to standard output rule for ssh dumps. And that is
scp. As scp can handle ssh destinations for file transfers, one can
@@ -521,9 +521,9 @@ scp /proc/vmcore <user@host>:path/vmcore
About default core collector
----------------------------
Default core_collector for ssh/raw dump is:
-"makedumpfile -F -c --message-level 1 -d 31".
+"makedumpfile -F -l --message-level 1 -d 31".
Default core_collector for other targets is:
-"makedumpfile -c --message-level 1 -d 31".
+"makedumpfile -l --message-level 1 -d 31".
Even if core_collector option is commented out in kdump.conf, makedumpfile
is default core collector and kdump uses it internally.
--
1.8.4.2
9 years, 9 months
[PATCH] Add makedumpfile.conf and its man page
by WANG Chao
makedumpfile can filter out kernel data from vmcore[1]. A how-to of feature
is well explained in makedumpfile.conf, which upstream is already
shipping but we're not.
Now add makedumpfile.conf and its man page to our package the upstream
way:
makedumpfile.conf --> /etc/makedumpfile.conf.sample
makedumpfile.conf.5.gz --> /usr/share/man/man5/makedumpfile.conf.5.gz
[1]. http://lists.infradead.org/pipermail/kexec/2011-September/005466.html
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kexec-tools.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index faf38d6..61128d0 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -209,6 +209,8 @@ install -m 755 %{SOURCE17} $RPM_BUILD_ROOT/usr/sbin/rhcrashkernel-param
%ifarch %{ix86} x86_64 ia64 ppc64 s390x
install -m 755 makedumpfile-1.5.4/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile
install -m 644 makedumpfile-1.5.4/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
+install -m 644 makedumpfile-1.5.4/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
+install -m 644 makedumpfile-1.5.4/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
install -m 755 makedumpfile-1.5.4/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
%endif
make -C kexec-tools-po install DESTDIR=$RPM_BUILD_ROOT
--
1.8.4.2
9 years, 9 months