Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 4 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. –  Daniel Oct 25 '12 at 7:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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