This makes the description string of the backlight service a bit nicer.
# Pull in backlight save/restore for all firmware backlight devices
# Pull in backlight save/restore for all firmware backlight devices
-ACTION=="add", SUBSYSTEM=="backlight", ATTR{type}=="firmware", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@sys%p.service"
+ACTION=="add", SUBSYSTEM=="backlight", ATTR{type}=="firmware", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@$name.service"
# Asynchronously mount file systems implemented by these modules as
# soon as they are loaded.
# Asynchronously mount file systems implemented by these modules as
# soon as they are loaded.
- device = udev_device_new_from_syspath(udev, argv[2]);
+ errno = 0;
+ device = udev_device_new_from_subsystem_sysname(udev, "backlight", argv[2]);
+ if (errno != 0) {
+ log_error("Failed to get backlight device: %m");
+ r = -errno;
+ } else
+ r = log_oom();
+
# (at your option) any later version.
[Unit]
# (at your option) any later version.
[Unit]
-Description=Load/Save Screen Backlight Brightness of %f
+Description=Load/Save Screen Backlight Brightness of %I
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
RequiresMountsFor=/var/lib/backlight
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
RequiresMountsFor=/var/lib/backlight
[Service]
Type=oneshot
RemainAfterExit=yes
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=@rootlibexecdir@/systemd-backlight load %f
-ExecStop=@rootlibexecdir@/systemd-backlight save %f
+ExecStart=@rootlibexecdir@/systemd-backlight load %I
+ExecStop=@rootlibexecdir@/systemd-backlight save %I