Sean Boudreau(deleted)
|
Re: Integrating a service with inetd
|
Sean Boudreau(deleted)
10/28/2008 10:59 AM
post15613
|
Re: Integrating a service with inetd
On Thu, Oct 09, 2008 at 02:58:05PM -0400, Gordon Molek wrote:
> We have several services (both TCP and UDP-based) that we would like to integrate with inetd so as to reduce the
system load. We have a TCP service that we would like to tightly control the number of incoming connection requests as
well as the number of established connections, so it would seem like having the service be a "wait" service, where our
app performs an accept() on the socket that inetd was listening on and then continue to listen()/accept() until the
maximum number of connections are handled, and when the servers goes idle for a period of time, exiting to let inetd
resume listening. So far, so good. However, the help pages for inetd.conf has the following statements:
>
> "Stream servers are usually marked as nowait, but if a single server process is to handle multiple connections it may
be marked as wait. The master socket is passed as fd 0 to the server, which then needs to accept the incoming connection
. The server should eventually time out and exit when no more connections are active. The inetd daemon will continue to
listen on the master socket for connections, so the server should not close it when it exits. The identd server is
usually the only stream server marked as wait."
>
> I don't know what "so the server should not close it (the master socket) when it exits" means. All file descriptors
of a process are closed when a process exits.
>
> Any help understanding what's meant by this?
>
Yes, that line doesn't make much sense. inetd doesn't close
it internally if it's marked as wait but it doesn't matter
what the spawned server does as it's closed on its behalf on
exit if it hasn't already done so.
-seanb
|
|
|