From: luke gruber Date: 2011-10-14T23:55:38+09:00 Subject: Re: Signal handling cross-platform >trap an OS signal that the host is shutting down, allowing Ruby to tidy >some things up first. For unix-like OS's, when the computer is shutting down all processes are sent a SIGTERM, so if you use the the trap method (defined in the Kernel module) like this, trap("TERM") do ...important stuff... ... end it should work. For other OS's, just find out what signals are sent on shutdown, and see if they match the signals recognized by your Ruby version by matching them against the output of Signal.list(). Hope this helps, -Luke -- Posted via http://www.ruby-forum.com/.