From: Daniel Berger Date: 2008-04-16T01:28:33+09:00 Subject: Re: at_exit handlers and Process.kill ts wrote: > Daniel Berger wrote: >> # process_test.rb >> File.open("pid.txt", "w"){ |fh| fh.print Process.pid } >> p Process.pid >> >> sleep 1 while true > > you really think that the following line will be executed ? Why not? The docs say at_exit, "Converts block to a Proc object (and therefore binds it at the point of call), and registers it for execution when the program exits." Well, the program exited, didn't it? If this just can't work then I think there needs to be a way to handle graceful cleanup without having to trap all the possible signals that could kill the program. Regards, Dan