summaryrefslogtreecommitdiff
path: root/98-kexec.rules
diff options
context:
space:
mode:
Diffstat (limited to '98-kexec.rules')
-rw-r--r--98-kexec.rules16
1 files changed, 16 insertions, 0 deletions
diff --git a/98-kexec.rules b/98-kexec.rules
new file mode 100644
index 0000000..b73b701
--- /dev/null
+++ b/98-kexec.rules
@@ -0,0 +1,16 @@
+SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload"
+SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload"
+SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
+SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload"
+
+GOTO="kdump_reload_end"
+
+LABEL="kdump_reload"
+
+# If kdump is not loaded, calling kdump-udev-throttle will end up
+# doing nothing, but systemd-run will always generate extra logs for
+# each call, so trigger the kdump-udev-throttler only if kdump
+# service is active to avoid unnecessary logs
+RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'"
+
+LABEL="kdump_reload_end"