Forum: Ruby DRb and signals

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-02-27 23:45
(Received via mailing list)
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
Eric Hodel (Guest)
on 2006-02-28 00:29
(Received via mailing list)
On Feb 27, 2006, at 2:45 PM, mental@rydia.net wrote:

>  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.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
Joel VanderWerf (Guest)
on 2006-02-28 01:34
(Received via mailing list)
Eric Hodel wrote:
>> with:
>
> $ 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].
Logan Capaldo (Guest)
on 2006-02-28 02:47
(Received via mailing list)
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]
unknown (Guest)
on 2006-02-28 15:59
(Received via mailing list)
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
This topic is locked and can not be replied to.