Using serial port for shutdown
I am thinking of using the serial port to sense the ACC off and then turn the computer off, something that's used for UPS, as implemented for APC UPS in XP SP2 in power settings. So the scenario would be the power is on, when the key is removed, the signal on the serial port changes (one of the pins, that is), which computer interprets as request for shutdown or hibernation. If the computer gets stuck and does not shut itself off then the additional hardware (relays, capacitors and the like) shuts the power, ie pulls the plug. The advantage of this is that there's a chance for computer to exit graciously before its whacked by pulling the plug. If it is not gracious, then it gets whacked. Maybe then it learns, don't we all learn when whacked?
My question is this: is there a software that would look at the serial port and has the functionality to shut the computer off, or somebody solved it similarly (ie software). APC UPS software communicates with the UPS using modem protocol, so it is not simple to adapt for my purpose.