inetd.conf File Format for TCP/IP
Purpose
Defines how the inetd daemon handles internet service requests.
Description
The /etc/inetd.conf file is the default configuration file for the inetd daemon. This file helps you specify the daemons to start by default and supply the arguments that correspond to the required style of functioning for each daemon. This file is part of TCP/IP in Network Support Facilities.
If you change the /etc/inetd.conf file, run the refresh -s inetd or kill -1 InetdPID command to inform the inetd daemon of the changes to its configuration file. The inetd.conf file specifies which daemons start by default and supplies arguments determining the style of functioning for each daemon.
The inetd daemon controls the following daemons:
The ftpd, rlogind, rexecd, rshd, talkd, telnetd, and uucpd daemons are started by default. The tftpd, fingerd, and comsat daemons are not started by default unless they are uncommented in the /etc/inetd.conf file.
Service Requests
The following internet service requests are supported internally by the inetd daemon and are used for debugging:
| Item | Description |
|---|---|
ECHO |
Returns data packets to a client host. |
DISCARD |
Discards received data packets. |
CHARGEN |
Discards received data packets and sends predefined or random data. |
DAYTIME |
Sends the current date and time in user-readable form. |
TIME |
Sends the current date and time in machine-readable form. |
The inetd daemon reads its configuration file only when the
inetd daemon starts, when the inetd daemon receives a
SIGHUP signal, or when the SRC refresh -s inetd command is
entered. Each line in the inetd configuration file defines how to handle one
internet service request only.
Each line is of the form:
ServiceName SocketType ProtocolName Wait/NoWait UserName ServerPath ServerArgs.
| Item | Description |
|---|---|
| ServiceName | Contains the name of an internet service that is defined in the etc/services file. For services provided internally by the inetd daemon, this name must be the official name of the service. That is, the name must be identical to the first entry on the line that describes the service in the /etc/services file. |
| SocketType | Contains the name for the type of socket that is used for the service. Possible values for
the SocketType parameter are:
|
| ProtocolName | Contains the name of an internet protocol that is defined in the /etc/protocols file. For example, use the
tcp value for a service that uses TCP/IP and the udp value for a
service that uses the User Datagram Protocol (UDP). |
| Wait/NoWait/SRC | Contains either the wait, the nowait, or the
SRC instruction for datagram sockets and the nowait
instruction for stream sockets. The Wait/NoWait/SRC field determines whether the
inetd daemon waits for a datagram server to release the socket before continuing
to listen at the socket. The SRC instruction works like wait, but instead of
forking and waiting for the child to die, it does a startsrc on the subsystem and
stores information about the starting of the service. When the service is removed from the
inetd.conf file and inetd is restarted, the service then has a
stopsrc issued to the service to stop it. If
DEBUG[=level] is specified after
wait or nowait, the SO_DEBUG socket debugging
flag will be turned on for this service. If level is specified, the trace level
is set to the specified level; otherwise the level is set to normal. Valid values
for level are min, normal, or
detail. |
| UserName | Specifies the user name that the inetd daemon uses to start the server. This variable allows a server to be given less permission than the root user. |
| ServerPath | Specifies the full path name of the server that the inetd daemon uses to execute to provide the service. For services that the inetd daemon provides internally, this field must be internal. |
| ServerArgs | Specifies the command line arguments that the inetd daemon uses to
execute the server. The maximum number of arguments is five. The first argument specifies the name
of the server used. If the SocketType parameter is sunrpc_tcp or
sunrpc_udp, the second argument specifies the program name, and the third argument
specifies the version of the program. For services that the inetd daemon provides
internally, this field must be empty. |
Examples
The following are example entries in the /etc/inetd.conf file for an inetd daemon:
- Uses the ftpd daemon for servicing ftp requests
- Uses the talkd daemon for ntalk requests
- Uses the telnetd daemon for telnet requests, sets the SO_DEBUG flag for sockets that are used for this service, and sets the trace level for these sockets to normal.
- Provides time requests internally.
ftp;stream tcp nowait root /usr/sbin/ftpd ftpd ntalk dgram udp wait root /usr/sbin/talkd talkd telnet stream tcp6 nowait|DEBUG root /usr/sbin/telnetd telnetd -a time stream tcp nowait root internal time dgram udp wait root internal
Files
| Item | Description |
|---|---|
| etc/services | Defines the sockets and protocols that are used for internet services. |
| /etc/protocols | Defines the internet protocols that are used on the local host. |