[systemd-devel] brightness in tmpfiles.d
Mantas Mikulėnas
grawity at gmail.com
Mon Aug 12 14:27:33 PDT 2013
On Mon, Aug 12, 2013 at 11:40 PM, Christian Hesse <list at eworm.de> wrote:
> Hello everybody,
>
> I have a file /etc/tmpfiles.d/brightness.conf containing this line:
>
> w /sys/class/backlight/acpi_video0/brightness - - - - 10
>
> This used to set the brightness on boot, but broke lately. The path is
> correct, so I assume this is a race condition. Any chance to get this work
> again?
Sure, and it involves *not* using tmpfiles.d.
I cannot know for sure, but yes, it is likely that it *is* a race
condition – tmpfiles.d being run before the relevant module gets
inserted, device gets detected, or whatever. And the usual way for
working with events like device detection is to write an udev rule
that triggers after that specific device has appeared:
ACTION=="add", SUBSYSTEM=="backlight",
KERNEL=="acpi_video0", ATTR{brightness}="10"
(I'm not 100% sure if the KERNEL match is correct. The rest should work.)
--
Mantas Mikulėnas <grawity at gmail.com>
More information about the systemd-devel
mailing list