Subject: bin/3647: inetd man page bug
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rickb@iaw.on.ca>
List: netbsd-bugs
Date: 05/18/1997 18:22:39
>Number:         3647
>Category:       bin
>Synopsis:       inetd(8) man page says stream/wait is invalid
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 18 15:35:01 1997
>Last-Modified:
>Originator:     Rick Byers
>Organization:
	Internet Access Worldwide
>Release:        1.2E May 9/97
>Environment:
System: NetBSD rickb.iaw.on.ca 1.2E NetBSD 1.2E (RICKB) #3: Sat May 10 20:04:10 EST 1997 root@rickb.iaw.on.ca:/usr/src/sys/arch/i386/compile/RICKB i386


>Description:
	The inetd(8) man page states that "The wait/nowait entry is 
	applicable to datagram sockets only", which is not true.  
	Stream sockets may also be marked as wait, in which case the
	master socket is passed to the server program, which then 
	accepts all of it's own connections.
>How-To-Repeat:
	man inetd 
	grep ident /etc/inetd.conf
>Fix:
Here is my fix.  

Index: inetd.8
===================================================================
RCS file: /usr/cvsroot/netbsd/src/usr.sbin/inetd/inetd.8,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -c -r1.1.1.2 -r1.2
*** inetd.8	1997/04/03 19:48:56	1.1.1.2
--- inetd.8	1997/05/18 23:09:44	1.2
***************
*** 182,195 ****
  or
  .Dq rpc/udp
  service type.
- 
  .Pp
  The
! .Em wait/nowait
! entry is applicable to datagram sockets only (other sockets should
! have a
! .Dq nowait
! entry in this space).  If a datagram server connects
  to its peer, freeing the socket so
  .Nm
  can receive further messages on the socket, it is said to be
--- 182,195 ----
  or
  .Dq rpc/udp
  service type.
  .Pp
  The
! .Em wait/nowait
! entry is used to tell
! .Nm
! if it should wait for the server program to return,
! or continue processing connections on the socket.
! If a datagram server connects
  to its peer, freeing the socket so
  .Nm
  can receive further messages on the socket, it is said to be
***************
*** 230,235 ****
--- 230,252 ----
  within an interval of 60 seconds. When omitted,
  .Dq max
  defaults to 40.
+ .Pp
+ 
+ .Pp
+ Stream servers are usually marked as
+ .Dq nowait
+ but if a single server process is to handle multiple connections, it may be
+ marked as
+ .Dq wait .
+ The master socket will then be passed as fd 0 to the server, which will then
+ need to accept the incoming connection.  The server should eventually time
+ out and exit when no more connections are active.
+ .Nm
+ will continue to
+ listen on the master socket for connections, so the server should not close
+ it when it exits. 
+ .Xr identd 8
+ is usually the only stream server marked as wait.
  .Pp
  The
  .Em user
>Audit-Trail:
>Unformatted: