From 65d37d19c783081041485ff75dccd9465b8dabb5 Mon Sep 17 00:00:00 2001 From: Pratyush Anand Date: Fri, 28 Jul 2017 09:39:26 +0530 Subject: [PATCH] Improve 'cpu add' udev rules Currently kdump service is restarted even when any new file is added in cpu subsystem. So, it can be restarted multiple times in the cases like loading of acpi_cpufreq module or online/offline of any cpu. However, we should see kdump service restart only once in case a new CPU is added or removed. cpu crash notes buffer is created when a new CPU is added. It's location does not change when a CPU is onlined/offlined or acpi_cpufreq driver is loaded. Therefore, no need to restart kdump service in such cases. Thus, we need to introduce an extra filter for the kernel name of the directory created by cpu_add which is KERNEL=="cpu[0-9]*". This will ensure that kdump service is not restarted when any new file is added in /removed from cpu subsystem. Signed-off-by: Pratyush Anand Acked-by: Dave Young --- 98-kexec.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/98-kexec.rules b/98-kexec.rules index e32ee13..5dcf9fa 100644 --- a/98-kexec.rules +++ b/98-kexec.rules @@ -1,4 +1,4 @@ -SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/bin/systemctl try-restart kdump.service" -SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/bin/systemctl try-restart kdump.service" +SUBSYSTEM=="cpu", ACTION=="add", KERNEL=="cpu[0-9]*", PROGRAM="/bin/systemctl try-restart kdump.service" +SUBSYSTEM=="cpu", ACTION=="remove", KERNEL=="cpu[0-9]*", PROGRAM="/bin/systemctl try-restart kdump.service" SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/bin/systemctl try-restart kdump.service" SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/bin/systemctl try-restart kdump.service"