jsr - Linux joystick reboot daemonjsr is a daemon that will perform certain commands when it detects joystick button action. The actions I have chosen to watch for are both buttons down and the release of one or both buttons after both have been detected. The stock version of jsr executes "/sbin/reboot" when it sees button combination one and "killall X" when it sees button combination two. These commands are overridable at compile time and run time. The original version, released in 1994, used version 0.7 of the joystick driver which did not support select(). As a result, it was configured to poll the joystick every 100Hz. Version 1.2.7 of the joystick driver supports select(). Instead of bugging the linux kernel every 10ms asking if there is any new data, jsr uses the select call which puts the jsr process to sleep until there is a change in the joystick state. This may turn out to be a bad thing. The polling driver may help keep the jsr code in memory as it is being accessed fairly often, if it is swapped out and we get into some strange race condition, it may not be readily available when the call to select() returns.
This page hosted by |