From: Simon Braunschmidt Date: Mon, 5 Jun 2023 11:49:45 +0000 (+0000) Subject: 99-systemd.rules.in: guard systemd-backlight udev rules by ENABLE_BACKLIGHT X-Git-Tag: v254-rc1~283 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99d3dd2ba7d6beb9508515cf1dae409e9da1998f;p=thirdparty%2Fsystemd.git 99-systemd.rules.in: guard systemd-backlight udev rules by ENABLE_BACKLIGHT Linux kernel will, as documented in drivers/video/backlight/backlight.c, report changes to a backlights brightness as a uevent (ACTION=change). systemd-udev will consume the uevent, match on this rule and try to activate the systemd-backlight service for the backlight. BUT when systemd is not compiled with backlight support, this will lead to failure that is reported in the journal. Since the failure to activate systemd-backlight and subsequent failure log entry happens on every backlight brightness change, we found the resulting logspam during regular operation excessive and came up with this patch to mitigate it. The conditional is also extended to "*kbd_backlight" match, since even though we did not investigate to see if the logspam would be similar, the unconditional match to activate systemd-backlight here would also not make sense when the feature is not compiled in. Signed-off-by: Simon Braunschmidt --- diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in index 3dbba1f850d..c0defc31de7 100644 --- a/rules.d/99-systemd.rules.in +++ b/rules.d/99-systemd.rules.in @@ -65,10 +65,12 @@ SUBSYSTEM=="udc", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="usb-gadget # Apply sysctl variables to network devices (and only to those) as they appear. ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="{{ROOTLIBEXECDIR}}/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name" +{% if ENABLE_BACKLIGHT %} # Pull in backlight save/restore for all backlight devices and # keyboard backlights SUBSYSTEM=="backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@backlight:$name.service" SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service" +{% endif %} # Pull in rfkill save/restore for all rfkill devices SUBSYSTEM=="rfkill", ENV{SYSTEMD_RFKILL}="1"