admiralakber / thinkpad-yoga-scripts

Thinkpad Yoga S1 scripts for GNU/Linux
http://blog.admiralakber.com/?p=400
GNU General Public License v3.0
147 stars 31 forks source link

yoga-backlight.service fails to load on boot (loaded too early?) #17

Open sjjh opened 8 years ago

sjjh commented 8 years ago

Running Ubuntu 15.10 I recognised following issue:

simon@laptop:/opt/thinkpad-yoga-scripts$ sudo systemctl status yoga-backlight.service
● yoga-backlight.service - [ThinkPad Yoga] Automatic backlight adjustment
   Loaded: loaded (/usr/lib/systemd/system/yoga-backlight.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Do 2015-12-31 11:21:37 CET; 4h 39min ago
 Main PID: 868 (code=exited, status=255)

Dez 31 11:21:36 laptop systemd[1]: Started [ThinkPad Yoga] Automatic backlight adjustment.
Dez 31 11:21:37 laptop env[868]: sensor not found
Dez 31 11:21:37 laptop systemd[1]: yoga-backlight.service: Main process exited, code=exited, status=255/n/a
Dez 31 11:21:37 laptop systemd[1]: yoga-backlight.service: Unit entered failed state.
Dez 31 11:21:37 laptop systemd[1]: yoga-backlight.service: Failed with result 'exit-code'.
simon@laptop:/opt/thinkpad-yoga-scripts$ sudo systemctl start yoga-backlight.service
simon@laptop:/opt/thinkpad-yoga-scripts$ sudo systemctl status yoga-backlight.service
● yoga-backlight.service - [ThinkPad Yoga] Automatic backlight adjustment
   Loaded: loaded (/usr/lib/systemd/system/yoga-backlight.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2015-12-31 16:01:21 CET; 3s ago
 Main PID: 26937 (python2)
   CGroup: /system.slice/yoga-backlight.service
           └─26937 python2 /opt/thinkpad-yoga-scripts/backlight/thinkpad-backlight.py

Dez 31 16:01:21 laptop systemd[1]: Started [ThinkPad Yoga] Automatic backlight adjustment.

I believe it's the same problem as #15 and #16. Probably all sensor related stuff could need some time out to make the code more robust? Would be cool if you could add another while()-loop at the correct place. Thanks a lot for your scripts!