d43fe6
SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload_cpu"
d43fe6
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload_mem"
d43fe6
SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload_mem"
603de6
603de6
GOTO="kdump_reload_end"
603de6
603de6
# If kdump is not loaded, calling kdump-udev-throttle will end up
603de6
# doing nothing, but systemd-run will always generate extra logs for
603de6
# each call, so trigger the kdump-udev-throttler only if kdump
603de6
# service is active to avoid unnecessary logs
d43fe6
d43fe6
LABEL="kdump_reload_mem"
d43fe6
603de6
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'"
603de6
d43fe6
GOTO="kdump_reload_end"
d43fe6
d43fe6
LABEL="kdump_reload_cpu"
d43fe6
d43fe6
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'"
d43fe6
603de6
LABEL="kdump_reload_end"