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