inetd(1M) inetd(1M)NAME inetd - starts Internet servers when needed SYNOPSIS inetd [-d] ARGUMENTS -d Turns on debugging traces for connection-oriented Transmission Control Protocol (TCP) servers. DESCRIPTION inetd is the Internet superserver that invokes all Internet servers when needed. The inetd daemon is started from /etc/inittab by init when the system is started up. When started, inetd reads /etc/services and supports the services that are listed there. The format of entries in /etc/servers for Remote Procedure Call (RPC) services is as follows: rpc protocol program RPC-program-number version-number where protocol can be udp or tcp, program is the full pathname of the program that implements the server, and RPC-program-number and version-number are the RPC program and version numbers, respectively, of the service. If the same program handles multiple versions, the version number can be specified as a range: rpc udp /usr/etc/rstatd 100001 1-2 Each time a request for a connection arrives, inetd invokes the appropriate connection service by creating a process and passing to it a file descriptor of 0 and an argument of the form sourcehost.sourceport. The sourcehost part of the argument is hexadecimal and sourceport is decimal. When a datagram arrives, inetd invokes the appropriate datagram-oriented service by creating a process and passing to it a file descriptor of 0. The inetd daemon does not check the socket where datagrams arrive for a new datagram until the process completes. Such processes read the incoming datagram and then fork and exit or handle the arriving datagram and then time out. Writing an RPC server You can use inetd to start an RPC server. The first difference from the usual code is that the function svcudp_create should be called as shown here, because inetd passes a socket file as descriptor 0: January 1992 1
inetd(1M) inetd(1M)transp = scvudp_create(0) The second difference is that svc_register should be called as shown here: svc_register(PROGNUM, VERSNUM, service, transp, 0) The last argument is 0 because the program is already registered by inetd. You must explicitly exit from the server process to return control to inetd, because scv_run never returns. LIMITATIONS There is no way to invoke TCP debugging-packet tracing on a per-service basis. The inetd daemon should reread the /etc/servers file on receipt of a SIGHUP signal. The /etc/servers file can have no more than 26 entries. FILES /etc/inetd Executable file /etc/servers File containing the list of Internet server processes SEE ALSO fingerd(1M), ftpd(1M), init(1M), remshd(1M), rexecd(1M), rlogind(1M), talkd(1M), telnetd(1M), tftpd(1M) servers(4) in A/UX Programmer's Reference 2 January 1992