[ale] Three d[a]emonic questions

Michael D. Hirsch mhirsch at nubridges.com
Wed Nov 17 09:08:35 EST 2004


On Tuesday 16 November 2004 10:51 pm, John Mills wrote:
> ALErs -
>
> I'm doing preliminary debug on a simple server I've written.
>
> 1) A few months ago (<=12), someone asked how to set things up so one
> instance of a service could be kept going, and promptly be restarted when
> it died or was killed. There were a couple of replies, but I can't refind
> the thread. Could anyone please remind me where to find this?

I can't recall exactly, but searching for inittab would be a good start.

> 2) If I use xinetd to start my server, I need to ensure that, if a running
> instance of the server exist, that is the one used. If not, a new one
> should be started. 'man xinetd' suggests this is a 'single_threaded'
> service. How do I designate a service to be this type?

I was doing this just last week.  Look at the wait attribute in the man page 
for xinetd.conf.  This does exactly what you want.

> 3) My server needs to listen on two ports. I want a connection on either
> port to use the same, single, running server, or start one if none is
> running at the moment. Can I achieve this with duplicate entries in
> /etc/services against the two port numbers? If not, how?

This I don't know about.  It's easy enough for one server to listen on two 
ports, but if you are also using xinetd it gets much trickier.  Xinetd would 
need to know that the two ports are associated, too, and I don't know how to 
do that.  I can't swear that it isn't possible, however.

Michael



More information about the Ale mailing list