-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crashkernel: check if crashmemory is available
If a kernel was started with crashmemory enabled, create /node/startup-crashmemory/available. This in turn will allow a conditional startup of the startup-crashmemory.service.
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#! /bin/sh | ||
|
||
# Workaround for systemd versions missing certain ConditionXY= features. | ||
# This helper is called by startup-crashmemory.service and creates | ||
# /node/startup-crashmemory/available | ||
# So other services can use | ||
# Wants=startup-crashmemory.service | ||
# After=startup-crashmemory.service | ||
# ConditionPathExists=/node/startup-crashmemory/available | ||
# to start a unit only if the memory can be used | ||
# | ||
|
||
kexec_crash_size='0' | ||
if [ -e /sys/kernel/kexec_crash_size ]; then | ||
kexec_crash_size=$(cat /sys/kernel/kexec_crash_size) | ||
fi | ||
mkdir -p /node/startup-crashmemory | ||
rm /node/startup-crashmemory/* 2>/dev/null | ||
if [ "$kexec_crash_size" != "0" ] ; then | ||
touch /node/startup-crashmemory/available | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Unit] | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
ExecStart=/usr/sbin/startup-crashmemory |