jsr - Linux joystick reboot daemon


jsr 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.
* jsr_daemon-1.2.tar.gz (34k) - July 1, 1998

Latest version. This version has been updated to use the select() call made available in newer joystick driver releases. To use jsr, you must first obtain AND properly install the joystick driver (possibly as a loadable module) and headers. To use jsr with select() support, you must obtain version 1.2.7 or greater of the joystick driver.

Look at http://atrey.karlin.mff.cuni.cz/~vojtech/joystick/ for information on the latest version of the joystick driver.

*

Troubleshooting

Don't use the binary included with jsr_daemon-1.1 with an old version of the driver. The option to use select() is a compile time flag; this binary will always use select, even if it is not there! Using it with an old version of the joystick driver causes jsr to eat as much CPU time as it can. It's CPU usage should be much much less than 3 percent, but using the old driver causes it to grab more than 96 percent.



Home * This page hosted by GeoCities.  Get your own Free Home Page.