cf4a81
SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload"
cf4a81
SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
cf4a81
SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload"
cf4a81
cf4a81
GOTO="kdump_reload_end"
cf4a81
cf4a81
LABEL="kdump_reload"
cf4a81
cf4a81
# If kdump is not loaded, calling "kdumpctl reload" will end up
cf4a81
# doing nothing, but it and systemd-run will always generate
cf4a81
# extra logs for each call, so trigger the "kdumpctl reload"
cf4a81
# only if kdump service is active to avoid unnecessary logs
cf4a81
RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet /usr/bin/kdumpctl reload'"
cf4a81
cf4a81
LABEL="kdump_reload_end"