* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / sample / drb / ring_place.rb
blob0ceef7c65af0329e64d7268d98c8ae83069ba4d6
1 require 'drb/drb'
2 require 'rinda/ring'
3 require 'rinda/tuplespace'
5 unless $DEBUG
6   # Run as a daemon...
7   exit!( 0 ) if fork
8   Process.setsid
9   exit!( 0 ) if fork
10 end
12 DRb.start_service(ARGV.shift)
14 ts = Rinda::TupleSpace.new
15 place = Rinda::RingServer.new(ts)
17 if $DEBUG
18   puts DRb.uri
19   DRb.thread.join
20 else
21   STDIN.reopen('/dev/null')
22   STDOUT.reopen('/dev/null', 'w')
23   STDERR.reopen('/dev/null', 'w')
24   DRb.thread.join
25 end