# DRb and xinetd / inetd

**URL:** <https://www.ruby-forum.com/t/drb-and-xinetd-inetd/99164>\
**Category:** Ruby\
**Created:** [July 20, 2006, 7:11pm UTC](https://www.ruby-forum.com/t/drb-and-xinetd-inetd/99164 "2006-07-20T19:11:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@Jon\_Evans](https://www.ruby-forum.com/u/Jon_Evans)\
**Post date:** [July 20, 2006, 7:11pm UTC](https://www.ruby-forum.com/t/drb-and-xinetd-inetd/99164/1 "2006-07-20T19:11:51Z")

</div>

Hi,

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?

Thanks

Jon

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}”  
DRb.thread.join
