Commit Graph

9 Commits

Author SHA1 Message Date
Philipp Rudo
ea00b7db43 kdumpctl: Move temp file in get_kernel_size to global temp dir
Others will need to use a temporary files, too. In order to avoid
potential clashes of multiple trap handlers move the local temp file
into a global temp dir.

While at it make sure that the trap handler returns the correct exit
code.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
Reviewed-by: Pingfan Liu <piliu@redhat.com>
Reviewed-by: Coiby Xu <coxu@redhat.com>
2023-05-16 09:21:13 +08:00
Jonathan Lebon
0084806493 kdump.service: use ConditionKernelCommandLine=crashkernel
Because otherwise, `kdumpctl start` will fail anyway. This makes it
easier to enable kdump by simply adding the mandatory karg and leaving
the service enabled.
2020-10-27 12:22:36 -04:00
Kairui Song
b34ce3a7b4 kdumpctl: Add reload support
Add reload support to kdumpctl, reload will simply unload current
loaded kexec crash kernel and initramfs, and load it again.

Changes in /etc/sysconfig/kdump will take effect with kdumpctl
reload, but reloading will not check the content of
/etc/kdump.conf and won't rebuild anything. reload is fast, the only
time-consuming part of kdumpctl reload is loading kernel and initramfs
with kexec which is always necessary.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2018-11-01 22:31:20 +08:00
Chao Fan
86b251765e make kdump work when kernel crash after shutdown
In RHEL6, vmcore file was created if panic occurred during shutdown. This was
very useful for analyzing problems during the shutdown sequence.

However, in RHEL7, vmcore will not be created after kdump service is stopped.
This will make it very difficult to solve problems during shutodwn.

The reason why kdump fails to dump vmcore is kdump is stopped too early during
the power is off.

If add "DefaultDependencies=no" to the [Unit] of kdump.service , kdump will
not be stopped by systemd after shutdown command.

The manpage of systemd.unit about the DefaultDependencies:
If true, (the default), a few default dependencies will implicitly be created
for the unit. The actual dependencies created depend on the unit type. For
example, for service units, these dependencies ensure that the service is
started only after basic system initialization is completed and is properly
terminated on system shutdown.

The manpage about basic.target:
A special target unit covering basic boot-up.
systemd automatically adds dependencies of the types Requires= and After= for
this target unit to all services (except for those with DefaultDependencies=no).
Usually this should pull-in all mount points, swap devices, sockets, timers,
and path units and other basic initialization necessary for general purpose
daemons.

So "DefaultDependencies=no" can keep kdump not stopped too early. But to make
it start when power on, add After=basic.target will be better.
The systemd-devel mailed to me:  using DefaultDependencies=no but also
After=basic.target will make sure the service isn't started too early (but kept
until systemd's final process killing spree).

Signed-off-by: Chao Fan <cfan@redhat.com>
Acked-by: Minfei Huang <mhuang@redhat.com>
2015-06-03 21:10:34 +08:00
Prarit Bhargava
f28832759e Disable the ratelimit of kdump service on hotplug events
When doing cpu softplug via /sys

ie)
        echo 0 > /sys/devices/system/cpu/cpuX/online
        echo 1 > /sys/devices/system/cpu/cpuX/online

the kdump service is restarted on every cpu up and down.  Eventually the
service stops because it is rate limited by systemd.

[root@dhg3 hoemann]# systemctl status kdump
kdump.service - Crash recovery kernel arming
   Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled)
   Active: failed (Result: start-limit) since Tue 2014-04-22 17:02:56 MDT; 59min ago
  Process: 8803 ExecStop=/usr/bin/kdumpctl stop (code=exited, status=0/SUCCESS)
  Process: 8911 ExecStart=/usr/bin/kdumpctl start (code=killed, signal=TERM)
 Main PID: 8911 (code=killed, signal=TERM)

Apr 22 17:02:56 dhg3 systemd[1]: Starting Crash recovery kernel arming...
Apr 22 17:02:56 dhg3 systemd[1]: Stopping Crash recovery kernel arming...
Apr 22 17:02:56 dhg3 systemd[1]: Starting Crash recovery kernel arming...
Apr 22 17:02:56 dhg3 systemd[1]: kdump.service start request repeated too quickly, refusing to start.
Apr 22 17:02:56 dhg3 systemd[1]: Failed to start Crash recovery kernel arming.
Apr 22 17:02:56 dhg3 systemd[1]: Unit kdump.service entered failed state.

The ratelimiting can be disabled by adding StartLimitInterval=0 to the kdump
service file.

Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-05-04 17:08:14 +08:00
WANG Chao
6a0fb27687 kdump.service: Start kdump after network is online and remote fs is mounted
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).

The downside of this patch is we always need to wait for network-online.target
even when dump target is a local disk. If network fails to come up,
kdump.service have to be stuck until network-online.target timeout (90
seconds by default).

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-09-27 10:07:13 +08:00
Orion Poplawski
f441ecab60 Fixup sysytemd service file (bug 741272)
Drop chkconfig (bug 786938)
2012-02-14 10:13:06 -07:00
Neil Horman
10c91a1493 Removing sysvinit files 2011-07-06 15:25:34 -04:00
Neil Horman
bf1475e066 Resolves: bz 716994
-Added systemd unit file for kdump
2011-07-04 16:32:15 -04:00