DRb and xinetd / inetd


I’ve written a simple DRb service and I’d like to run it under xinetd
so that xinetd can babysit it and restart it if it crashes.

I tried my script with no modifications and it didn’t work, because
(obviously in hindsight) xinetd opens the port that my DRb service is
configured to listen to, so it refuses to start up.

How can I rewrite my script so that it starts a DRb service listening
on the socket that xinetd passes to the process when it starts up?



PS my script, trimmed to only show the relevant parts:

#!/usr/bin/env ruby

require ‘drb’
require ‘myserver’

DRb.start_service(“druby://localhost:10070”, MyServerClass.new)
puts “DRb infra login service listening on #{DRb.uri}”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs