On Tue 19/02/08 4:35 PM , "Shawn Rutledge" [EMAIL PROTECTED] sent: [snip] > Or the abstraction could even be pushed down into the kernel, so that > when you frob the /sys/whatever to turn off the radio it sends that > POFF command, and when you try to turn it on, it does it the other > way. That way as long as the kernel is shut down normally rather than > crashing, it will still work.
The compromise I proposed (and tested, and I still use today) is to have a simple shutdown script in /etc/init.d, with the appropriate symlink from /etc/rcX.d/Kxxxx. The "x"s should be replaced with values that ensure that the kill script runs when the system is pretty much shutdown; i.e. we can safely assume that all gsmd's have had an opportunity to exit cleanly if they were running in the first place. (I'd post the values I chose for the "x"s except that I'm nowhere near home and can't check right now.) The script simply resets the GSM modem, sets the serial port to the correct flow control and echo settings, and issues the [EMAIL PROTECTED] command. Voila, modem powered off at normal shutdown, regardless of the state of gsmd. There was significant opposition to my original solution, however, hence I started this thread by asking the community here for solutions rather than just leading with my (unacceptable) solution. Mike (mwester)