cf4816
SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload_cpu"
cf4816
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload_mem"
cf4816
SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload_mem"
b9e861
b9e861
GOTO="kdump_reload_end"
b9e861
b9e861
# If kdump is not loaded, calling kdump-udev-throttle will end up
b9e861
# doing nothing, but systemd-run will always generate extra logs for
b9e861
# each call, so trigger the kdump-udev-throttler only if kdump
b9e861
# service is active to avoid unnecessary logs
cf4816
cf4816
LABEL="kdump_reload_mem"
cf4816
b9e861
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'"
b9e861
cf4816
GOTO="kdump_reload_end"
cf4816
cf4816
LABEL="kdump_reload_cpu"
cf4816
cf4816
RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; ! test -f /sys/kernel/fadump_enabled || cat /sys/kernel/fadump_enabled | grep 0  || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'"
cf4816
b9e861
LABEL="kdump_reload_end"