Re: [systemd-devel] brightness in tmpfiles.d

2013-09-11 Thread Lennart Poettering
On Mon, 12.08.13 22:40, Christian Hesse (l...@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?

Just a quick follow-up on this. systemd git now includes a tiny tool to
save/restore the backlight late at shutdown/early at boot, similar to
how we handle random seed already. This should make all manual dealing
with tmpfiles/udev rules unnecessary, and just make this all work.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-13 Thread Christian Hesse
Mantas Mikulėnas graw...@gmail.com on Tue, 2013/08/13 00:27:
 On Mon, Aug 12, 2013 at 11:40 PM, Christian Hesse l...@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);}


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Christian Hesse
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?
-- 
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);}


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Mantas Mikulėnas
On Mon, Aug 12, 2013 at 11:40 PM, Christian Hesse l...@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 graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Kay Sievers
On Mon, Aug 12, 2013 at 11:27 PM, Mantas Mikulėnas graw...@gmail.com wrote:
 On Mon, Aug 12, 2013 at 11:40 PM, Christian Hesse l...@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.)

Looks fine.

Remembering brightness sounds pretty useful for everyone. In the
longer run, it should probably be handled like ALSA restore for the
sound volume, with a service that writes it to /var/lib and reads it
from there ...

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Mantas Mikulėnas
On Tue, Aug 13, 2013 at 12:54 AM, Kay Sievers k...@vrfy.org wrote:
 Remembering brightness sounds pretty useful for everyone. In the
 longer run, it should probably be handled like ALSA restore for the
 sound volume, with a service that writes it to /var/lib and reads it
 from there ...

I guess this is hardware-dependent... In my case, it looks like the
opposite – the firmware /does/ remember brightness for me, but during
boot something resets it to maximum.

-- 
Mantas Mikulėnas graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel