1

I have a simple script which set keyboard back-light to 0 on startup. It work if invoked manually. And I have service which should invoke it on startup.

[Unit]
Description=Power_off keyboard backlight on startup

[Service]
Type=oneshot
ExecStart=/etc/kbd_to_zero
RemainAfterExit=yes
[Install]
WantedBy=default.target

And this service works fine when running command systemctl enable now or start. But it does nothing on startup. journalctl says that

січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Starting Power_off keyboard backlight on startup...
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /sys/class/leds/asus::kbd_backlight/brightness
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session opened for user root by (uid=0)
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA kbd_to_zero[3364]: 0
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session closed for user root
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Started Power_off keyboard backlight on startup.

What I'm doing wrong.

Thanks

| improve this question | | | | |
1

Did you try running the enable command? Assuming your service is called keyboard-backlight.service, try running the following: systemctl enable keyboard-backlight.service.

| improve this answer | | | | |
  • Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens. – Mitya Jan 24 '19 at 10:18
  • Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works. – Mitya Jan 24 '19 at 10:41
  • I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-) – TSJNachos117 Jan 27 '19 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.