2004-02-14 05:28:02 +03:00
|
|
|
require 'drb/drb'
|
|
|
|
require 'rinda/ring'
|
|
|
|
require 'rinda/tuplespace'
|
|
|
|
|
|
|
|
unless $DEBUG
|
|
|
|
# Run as a daemon...
|
|
|
|
exit!( 0 ) if fork
|
|
|
|
Process.setsid
|
|
|
|
exit!( 0 ) if fork
|
|
|
|
end
|
|
|
|
|
|
|
|
DRb.start_service(ARGV.shift)
|
|
|
|
|
|
|
|
ts = Rinda::TupleSpace.new
|
|
|
|
place = Rinda::RingServer.new(ts)
|
|
|
|
|
|
|
|
if $DEBUG
|
|
|
|
puts DRb.uri
|
|
|
|
DRb.thread.join
|
|
|
|
else
|
2014-08-10 06:41:03 +04:00
|
|
|
STDIN.reopen(IO::NULL)
|
|
|
|
STDOUT.reopen(IO::NULL, 'w')
|
|
|
|
STDERR.reopen(IO::NULL, 'w')
|
2004-02-14 05:28:02 +03:00
|
|
|
DRb.thread.join
|
|
|
|
end
|