Petr Šabata f5bf49
SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload"
Petr Šabata f5bf49
SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload"
Petr Šabata f5bf49
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
Petr Šabata f5bf49
SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload"
Petr Šabata f5bf49
Petr Šabata f5bf49
GOTO="kdump_reload_end"
Petr Šabata f5bf49
Petr Šabata f5bf49
LABEL="kdump_reload"
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
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
Petr Šabata f5bf49
LABEL="kdump_reload_end"