[systemd-devel] brightness in tmpfiles.d

Christian Hesse list at eworm.de
Tue Aug 13 01:38:01 PDT 2013


Mantas Mikulėnas <grawity at gmail.com> on Tue, 2013/08/13 00:27:
> 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.)

Makes sense to use udev for this kind of things... I am not sure why I
decided to use tmpfiles. Thanks for your hint!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130813/c18f3d1b/attachment.pgp>


More information about the systemd-devel mailing list