[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

DRb and signals

MenTaLguY

2/27/2006 10:45:00 PM

Using DRb appears to disable signal handlers in Ruby, at least in
1.8.4. Is there any way to work around this?

Compare:

trap( "SIGINT" ) { puts "foo" ; exit 0 }
loop do sleep 1 end

with:

require 'drb'
DRb.start_service
trap( "SIGINT" ) { puts "foo" ; exit 0 }
loop do sleep 1 end

In the second case, sending the process a SIGINT appears to have no
effect at all...

-mental


4 Answers

Eric Hodel

2/27/2006 11:27:00 PM

0

On Feb 27, 2006, at 2:45 PM, mental@rydia.net wrote:

> Using DRb appears to disable signal handlers in Ruby, at least in
> 1.8.4. Is there any way to work around this?
>
> Compare:
>
> trap( "SIGINT" ) { puts "foo" ; exit 0 }
> loop do sleep 1 end
>
> with:
>
> require 'drb'
> DRb.start_service
> trap( "SIGINT" ) { puts "foo" ; exit 0 }
> loop do sleep 1 end
>
> In the second case, sending the process a SIGINT appears to have no
> effect at all...

Not seeing it:

$ ruby -v -
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]
require 'drb'
DRb.start_service
trap( "SIGINT" ) { puts "foo" ; exit 0 }
loop do sleep 1 end
^Cfoo
$

There's a ^D in there under the ^C, but it got eaten.

--
Eric Hodel - drbrain@segment7.net - http://blog.se...
This implementation is HODEL-HASH-9600 compliant

http://trackmap.rob...




Joel VanderWerf

2/28/2006 12:33:00 AM

0

Eric Hodel wrote:
> On Feb 27, 2006, at 2:45 PM, mental@rydia.net wrote:
>
>> Using DRb appears to disable signal handlers in Ruby, at least in
>> 1.8.4. Is there any way to work around this?
>>
>> Compare:
>>
>> trap( "SIGINT" ) { puts "foo" ; exit 0 }
>> loop do sleep 1 end
>>
>> with:
>>
>> require 'drb'
>> DRb.start_service
>> trap( "SIGINT" ) { puts "foo" ; exit 0 }
>> loop do sleep 1 end
>>
>> In the second case, sending the process a SIGINT appears to have no
>> effect at all...
>
> Not seeing it:
>
> $ ruby -v -
> ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

Seems ok also with ruby 1.8.4 (2005-12-24) [i686-linux].

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


Logan Capaldo

2/28/2006 1:47:00 AM

0


On Feb 27, 2006, at 7:33 PM, Joel VanderWerf wrote:

> Seems ok also with ruby 1.8.4 (2005-12-24) [i686-linux].

I got the same result as Eric.
% ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

MenTaLguY

2/28/2006 2:58:00 PM

0

Quoting Logan Capaldo <logancapaldo@gmail.com>:

>
> On Feb 27, 2006, at 7:33 PM, Joel VanderWerf wrote:
>
> > Seems ok also with ruby 1.8.4 (2005-12-24) [i686-linux].
>
> I got the same result as Eric.
> % ruby -v
> ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

Hmm, okay, thanks. I guess it's an HP-UX issue.

$ ruby -v
ruby 1.8.4 (2005-12-24) [hppa2.0w-hpux11.11]

-mental