[PATCH] kdump.service: Start kdump after network is online and remote fs is mounted
by WANG Chao
Now kdump.service runs "After" network.target. But network.target
doesn't mean network is setup and online[1]. We should use
network-online.target instead for ssh/nfs dump.
And also because nfs dump requires a mounted nfs when rebuilding kdump
initrd, kdump.service should also run "After" remote-fs.target (this
means all remote fs configured in /etc/fstab is mounted).
1. http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
I tested local/nfs/ssh dump. Local and nfs dump works ok. But ssh dump has a
problem (not related to kdump).
I opend a bz to NetworkManager:
https://bugzilla.redhat.com/show_bug.cgi?id=997318
kdump.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.service b/kdump.service
index 07e97fa..55b7ca2 100644
--- a/kdump.service
+++ b/kdump.service
@@ -1,6 +1,6 @@
[Unit]
Description=Crash recovery kernel arming
-After=network.target
+After=network.target network-online.target remote-fs.target
[Service]
Type=oneshot
--
1.8.3.1
10 years, 2 months
[Patch] Rawhide - Allow inline comments in config file.
by Wade Mealing
The RHEL 5 release of mkdumprd allowed for comments in the kdump config file
as shown below:
net 192.168.1.1 # this is the comment part
The Fedora 18/19/Rawhide release would fail when inline comments were used
at runtime and when building the initrd.
This patch introduces a function which is repeated a few times, but
could be broken out at a later date into its an existing or new shell
library which could be source.
This patch does not introduce any new functionality.
This patch includes the suggestions by David Young to fix my whitespace
errors.
I have not tested this patch as I do not yet have build permissions on koji.
10 years, 2 months
[PATCH] kdumpctl: Run multiple kdumpctl instances one by one in serial order
by WANG Chao
There will be a race condition if multiple kdumpctl instances are
running at the same time.
By introducing a global mutex lock, only one instance can acquire this
lock and run, others will be waiting for the lock in queue. Now each
kdump instance will be run in serial order and there won't any race
condition.
This is a patch backported from RHEL6.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdumpctl | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index aba1e3c..d62b4b4 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -16,6 +16,12 @@ if [ -f /etc/sysconfig/kdump ]; then
. /etc/sysconfig/kdump
fi
+single_instance_lock()
+{
+ exec 9>/var/lock/kdump
+ flock 9
+}
+
# remove_cmdline_param <kernel cmdline> <param1> [<param2>] ... [<paramN>]
# Remove a list of kernel parameters from a given kernel cmdline and print the result.
# For each "arg" in the removing params list, "arg" and "arg=xxx" will be removed if exists.
@@ -531,6 +537,9 @@ if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
exit 1
fi
+# Other kdumpctl instances will block in queue, until this one exits
+single_instance_lock
+
case "$1" in
start)
if [ -s /proc/vmcore ]; then
--
1.8.3.1
10 years, 2 months
Can we update the supported kernel to 3.10?
by Baoquan He
Hi Atsushi,
I noticed in Makedumpfile 1.5.4 the supported kernel is upgrade to
3.9.6. Now in our fedora distro, it's tracking linux kernel 3.10+. Then
makedumpfile will always give a warning like below:
"The kernel version is not supported."
"The created dumpfile may be incomplete."
Since currently it's in 3.11-rc6, can we upgrade the "LATEST_VERSION" to
"3.10"?
Baoquan
Thanks a lot
10 years, 2 months
[PATCH] kdump.sysconfig: default to "nofail" mount
by WANG Chao
Currently we have two issues against mounting filesystems by systemd.
1. If any failure in sysroot.mount, initrd.target won't be reached.
2. If any failure in mounting /etc/fstab, initrd.target won't be reached
Our kdump.sh is in dracut-pre-pivot hook which is ordered after
initrd.target. That means if systemd doesn't reach initrd.target,
pre-pivot service will not run.
To fix issue 1), we can add rootflags=nofail to 2nd kernel cmdline, so
that initrd.target will not require sysroot.mount. initrd.target
wouldn't care about the failures in sysroot.mount. And our kdump.sh will
run eventually.
To fix issue 2), we can append "nofail" mount options to every entry in
/etc/fstab. It has almost the same affects as to sysroot.mount.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
mkdumprd | 1 +
5 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 1425ce1..0d26a66 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 rootflags=nofail"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 22e7bd5..ca7e1d8 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 129b205..b55515a 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="maxcpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10"
+KDUMP_COMMANDLINE_APPEND="maxcpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 rootflags=nofail"
# Any additional /sbin/mkdumprd arguments required.
MKDUMPRD_ARGS=""
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index a143b5c..7e4d611 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/mkdumprd b/mkdumprd
index 26fe5af..02521bf 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -102,6 +102,7 @@ to_mount() {
_t=$(findmnt -k -f -n -r -o TARGET,FSTYPE $_dev)
_o=$(findmnt -k -f -n -r -o OPTIONS $_dev)
_o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel
+ _o="${_o},nofail" #with nofail set, systemd won't block for mount failyre
_mntopts="$_t $_o"
#for non-nfs _dev converting to use udev persistent name
if [ -b "$_s" ]; then
--
1.8.3.1
10 years, 3 months
[PATCH] kdump.sysconfig: Add rootflags=nofail and rd.fstab=0 to 2nd kernel cmdline
by WANG Chao
Currently we have two issues against mounting filesystems by systemd.
1. If any failure in sysroot.mount, initrd.target won't be reached.
2. If any failure in mounting /etc/fstab, initrd.target won't be reached
Our kdump.sh is in dracut-pre-pivot hook which is ordered after
initrd.target. That means if systemd doesn't reach initrd.target,
pre-pivot service will not run.
To fix issue 1), we can add rootflags=nofail to 2nd kernel cmdline, so
that initrd.target will not require sysroot.mount. initrd.target
wouldn't care about the failures in sysroot.mount. And our kdump.sh will
run eventually.
To fix issue 2), we can add rd.fstab=0. With this specified in kernel
cmdline, systemd won't mount anything from /etc/fstab so that
initrd.target won't have a dependency on the mount unit. Instead a
dracut module 95fstab-sys, will install 00-mount-sys.sh to pre-pivot
hook. 00-mount-sys.sh will mount everything from /etc/fstab and even if
it fails to mount, kdump will run.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump.sysconfig.i386 | 2 +-
kdump.sysconfig.ppc64 | 2 +-
kdump.sysconfig.s390x | 2 +-
kdump.sysconfig.x86_64 | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 1425ce1..534f6d4 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices numa=off udev.children-max=2 panic=10 rootflags=nofail rd.fstab=0"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index 22e7bd5..40f67d4 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10"
+KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail rd.fstab=0"
# Any additional kexec arguments required. In most situations, this should
# be left empty
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 129b205..8e0af33 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="maxcpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10"
+KDUMP_COMMANDLINE_APPEND="maxcpus=1 cgroup_disable=memory numa=off udev.children-max=2 panic=10 rootflags=nofail rd.fstab=0"
# Any additional /sbin/mkdumprd arguments required.
MKDUMPRD_ARGS=""
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index a143b5c..938586e 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -16,7 +16,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us append arguments to the current kdump commandline
# As taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
-KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10"
+KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail rd.fstab=0"
# Any additional kexec arguments required. In most situations, this should
# be left empty
--
1.8.3.1
10 years, 3 months
Re: [PATCH] systemd: pre-pivot hooks runs after /sysroot is mounted
by WANG Chao
On 08/16/13 at 01:13pm, WANG Chao wrote:
> If rootflags=nofail, sysroot.mount won't strictly run "Before"
> initrd-root-fs.target. So we need to order dracut-pre-pivot after
> sysroot.mount.
[ CC kexec(a)lists.fedoraproject.org ]
> ---
> modules.d/98systemd/dracut-pre-pivot.service | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
> index 56818b9..dd4e49b 100644
> --- a/modules.d/98systemd/dracut-pre-pivot.service
> +++ b/modules.d/98systemd/dracut-pre-pivot.service
> @@ -10,7 +10,7 @@
> [Unit]
> Description=dracut pre-pivot and cleanup hook
> Documentation=man:dracut-pre-pivot.service(8)
> -After=initrd.target initrd-parse-etc.service
> +After=initrd.target initrd-parse-etc.service sysroot.mount
> After=dracut-initqueue.service dracut-pre-mount.service dracut-mount.service
> Before=initrd-cleanup.service
> ConditionPathExists=/etc/initrd-release
> --
> 1.8.3.1
>
10 years, 3 months
[PATCH] Rawhide - Allow inline comments in kdump config file.
by Wade Mealing
This patch attempts to remove all inline comments so that the key/value type directives
in the kdump config file are used correctly in the dumprd generation.
Changes made as per Dave Youngs request:
* Fixed multiple instances in this code where the config_opt/config_val is read.
* Initial eyeball to see if config_val is being set by any other mechanism (grep, etc).
I have not tested this patch other than light testing as I do not have a 19/rawhide machine or build permissions on koji.
For those with the ability to run advanced/more testing, please confirm that this doesn't break anything.
Signed-off-by: Wade Mealing <wmealing(a)redhat.com>
10 years, 3 months
[Fedora Patch] kdump.service: Start kdump after network is online and remote fs is mounted
by WANG Chao
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
kdump.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump.service b/kdump.service
index 07e97fa..55b7ca2 100644
--- a/kdump.service
+++ b/kdump.service
@@ -1,6 +1,6 @@
[Unit]
Description=Crash recovery kernel arming
-After=network.target
+After=network.target network-online.target remote-fs.target
[Service]
Type=oneshot
--
1.8.3.1
10 years, 3 months