2011-07-04 20:32:15 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Crash recovery kernel arming
|
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-05-14 07:04:11 +00:00
|
|
|
After=network.target network-online.target remote-fs.target basic.target
|
|
|
|
DefaultDependencies=no
|
2020-10-27 16:22:36 +00:00
|
|
|
ConditionKernelCommandLine=crashkernel
|
2011-07-04 20:32:15 +00:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2011-07-06 19:25:34 +00:00
|
|
|
ExecStart=/usr/bin/kdumpctl start
|
|
|
|
ExecStop=/usr/bin/kdumpctl stop
|
2018-10-23 14:13:28 +00:00
|
|
|
ExecReload=/usr/bin/kdumpctl reload
|
2011-07-04 20:32:15 +00:00
|
|
|
RemainAfterExit=yes
|
2014-05-02 14:28:34 +00:00
|
|
|
StartLimitInterval=0
|
2023-05-05 15:14:41 +00:00
|
|
|
PrivateTmp=yes
|
2011-07-04 20:32:15 +00:00
|
|
|
|
2012-02-14 17:13:06 +00:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|