From: ts Date: 2008-04-16T02:09:21+09:00 Subject: Re: at_exit handlers and Process.kill Daniel Berger wrote: > How do I create an all purpose cleanup handler within a Ruby program > that will fire off no matter how the script is terminated? at_exit and trap the signal that you want but *please* do this *before* 'sleep 1 while true' moulon% ruby -e 'at_exit { puts :exit}; trap("TRAP") { puts :SIGTRAP; exit }; sleep 1 while true' SIGTRAP exit moulon% Guy Decoux