From: "Wayne E. Seguin" Date: 2007-07-29T01:50:10+09:00 Subject: Re: Why is it so hard to kill Ruby? --Apple-Mail-1--971694459 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jul 27, 2007, at 16:20 , David Harkness wrote: > I've written some scripts that are nearly immortal. > > Basically I wrote a loop, with a couple layers of rescues. > > The Ctrl C would Raise an error, which would be caught by a rescue, > and > then the loop would start again. > > My final solution, I'm sure there are more elegant ones, was to to > put a > sleep 5, after a rescue clause, before the loop started again. > > This gave time to get two Ctrl C's in. > > Tim Hunter wrote: >> Since I've been using Ruby I've noticed that a running Ruby script is >> hard to kill. Control-C won't do it. I have to use kill -9. Today I >> notice it with Ruby 1.8.6 on OS X 10.4.9, but it's been this way >> since I >> started using Ruby 6 or so years ago on Mandrake Linux. Do I have the >> wrong expectations? Or you could wrap the script to explicitly catch that signal sent from the command line. -- Wayne E. Seguin Sr. Systems Architect & Systems Admin wayneseguin@gmail.com --Apple-Mail-1--971694459--