9

I've just upgraded Ubuntu (15.04 to 15.10) and now I'm running into a weird behavior: whenever I lock the screen (using any of Ctrl+Alt+L, Win+L or just clicking on "Lock" in the taskbar menu), the keyboard backlight turns on, even though I always keep it off.

I have no idea where to begin investigating this. It didn't happen in Ubuntu 15.04, and it doesn't seem other people have run into this.

My laptop is a Dell Inspiron, if it helps.

Update: I later understood that this problem happens whenever the display turns on, which happens right after I lock the screen because of a bug. So, these are related events, but the actual cause is the screen turning on.

  • Who makes the keyboard? – Alex Lowe Nov 19 '15 at 15:59
  • Hm, I don't know. Do you know how I can check that? – dsetton Nov 19 '15 at 16:04
  • Maybe on the back there might be a model number or something like that. – Alex Lowe Nov 19 '15 at 16:06
  • There's nothing that's keyboard-specific on the back. I installed the hardinfo package and the keyboard is displayed as "AT Translated Set 2 keyboard" by vendor "1". Does that help at all?... – dsetton Nov 19 '15 at 16:13
  • Is there a driver or software for that keyboard that you know of? – Alex Lowe Nov 19 '15 at 16:49
13

So, the Web is truly an amazing thing! After much research and diving into many forum links, I managed to better understand the problem, to find out what program was responsible for it and, finally, to disable this behavior for good. I thought I'd write down my steps, in case other people run into the same issue.

Step 1. Monitor the system to know if/when the keyboard backlight is being turned on

The first thing is to know that the current status of the keyboard backlight can be checked by reading the file /sys/devices/platform/dell-laptop/leds/dell\:\:kbd_backlight/brightness. So, we would like to be notified of any changes to this file and, ideally, what process invoked the change.

This can be done using fanotify. I used the example program that is provided in the man page and added a few modifications* so that I could monitor changes to the brightness file. Turns out that the process responsible for the modification was /usr/lib/upower/upowerd, which is a daemon process for UPower.

Step 2. Find out why UPower is turning the backlight on (fail)

This was the fuzziest part of the investigation, and I still can't tell why this happens. I found a person with a very similar problem but with no solution, so I started to see if I could just disable UPower completely (and what would the consequences be) when I found this link. Turns out UPower has a configuration file! That's better.

Step 3. Stop UPower from turning on the keyboard backlight

Finally, I edited the aforementioned config file, located at /etc/dbus-1/system.d/org.freedesktop.UPower.conf, and changed <allow> to <deny> in the following line:

<allow send_destination="org.freedesktop.UPower"
       send_interface="org.freedesktop.UPower.KbdBacklight"/>

I then restarted dbus with sudo service dbus restart (use systemctl restart dbus.service on Ubuntu 16.04 and later) and proceeded to lock my screen to test the result and... It worked!! Well, sorta. The login screen wouldn't show up, so I couldn't log back in and had to force a restart. But then everything worked great!

And that's it! I'm still curious what would be the right way to do this. If you know, leave a comment, please!

* For instance, the example program was only set up to monitor FAN_OPEN_PERMand FAN_CLOSE_WRITE events, but in this it was an FAN_MODIFY event.

  • I just edited the file org.freedesktop.UPower.conf as you specified, and it worked. I think the change was applied immediately. – Vic Dec 19 '15 at 7:19
  • 1
    Thanks man :) it worked. you deserve a beer! what is your A/c number ;) for now handle this +1 cheers – The VOYOU Feb 12 '16 at 16:18
  • @TheVOYOU Glad it worked for you! :) – dsetton Feb 15 '16 at 12:56
  • This fix also works for 16.04, except for some reason I can't restart the dbus service anymore. I had to reboot my laptop. – RoraΖ Aug 31 '16 at 17:08

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.