Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The file /sys/devices/platform/samsung/leds/samsung::kbd_backlight/brightness gets written to by some process each time the screen wakes up from being blank.

Is there a way to find out which process writes to this file?

share|improve this question
up vote 5 down vote accepted

Well, my initial thought was to use inotify a la inotify-tools, but it seems that is impossible, because "The inotify API provides no information about the user or process that triggered the inotify event." (source) Sometimes it's helpful to know what won't work, too, so here it is.

fanotify is a separate, competing notify framework for Linux, which is newer and more robust, and the API does contain information about the process ID (pid) of the program that did the event.

I'm not sure if Fedora 17 has a fanotify command built in (or similar). If not, you can see a sample fanotify program here. It does print out the Process ID (pid) of the process that did the event, so you can compile that program (if it's still compatible with the latest fanotify ABI on Fedora 17) and run it and it should work. See line 231 of this file.

share|improve this answer
Great, thanks a lot, fanotify does work! It turns out upowerd is messing with the keyboard backlight brightness. – DanielFetchinson Oct 25 '12 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .