inetd daemon — Provide service management for networks

Format

inetd [–d] [configuration file]

Description

The inetd daemon provides service management for a network. For example, it starts the rlogind program whenever there is a remote login request from a workstation.

The rlogind program is the server for the remote login command rlogin commonly found on UNIX systems. It validates the remote login request and verifies the password or password phrase of the target user. It starts a z/OS shell for the user and handles translation between ASCII and EBCDIC code pages as data flows between the workstation and the shell.

When inetd is running and receives a request for a connection, it processes that request for the program associated with that socket. For example, if a user tries to log in from a remote system into the z/OS shell while inetd is running, inetd processes the request for connection and then issues a fork() and execl() to the rlogin program to process the rlogin request. It then goes back to monitoring for further requests for those applications that can be found as defined in the /etc/inetd.conf file.

Options

–d
Specifies that the inetd daemon be started in debug mode. All debug messages are written to standard error (stderr).
configuration file
Specifies that the inetd daemon be started with a configuration file other than the default /etc/inetd.conf file.

Signals

inetd recognizes the following signals:
SIGTERM
Terminates inetd in an ordinary fashion and deletes /etc/inetd.pid. You can restart inetd, if you want.
SIGINT
Same as SIGTERM.
SIGHUP
Rereads the inetd configuration file. This can be used to start new services, or to restart services with a different port.

Other signals that normally end a process (such as SIGQUIT or SIGKILL) should not normally be sent to inetd because the program will not have a chance to remove /etc/init.pid.

Usage notes

  1. Buffer sizes should only be specified if the documentation for the daemon being specified in the inetd.conf statement calls for something other than the default.
  2. The configuration file is field-sensitive, but not column-sensitive. Fields must be arranged in the order shown in Table 1. Continuation lines for an entry must begin with a space or tab. Each entry must contain all fields. The inetd daemon uses the configuration file entry to properly set up the environment expected by the server. Specifying an incorrect value for one or more of the parameters is likely to cause the server to fail.
    Table 1. Fields in the configuration file (inetd daemon)
    Field Description
    [ip_address:]service_name

    ip_address is a local IP, followed by a colon. If specified, the address is used instead of INADDR_ANY or the current default. To specifically request INADDR_ANY, use "*:". If ip_address (or a colon) is specified, without any other entries on the line, it becomes the default for subsequent lines until a new default is specified.

    service_name is a well-known service name such as login or shell. The name and protocol specified must match one of the server names defined in /etc/services. For more information about /etc/services, see z/OS V2R1.0 Communications Server: IP Configuration Reference. and z/OS V2R1.0 Communications Server: New Function Summary
    socket_type Stream or dgram
    protocol [,sndbuf=n][,rcvbuf=n]

    protocol can be tcp or udp, or (for IPv6) tcp6 or udp6. tcp4 and udp4 can also be specified to explicitly request IPv4. The protocol is used to further qualify the service name. Both the service name and the protocol should match an entry in /etc/services, except that, the "4" or the "6" should not be included in the /etc/services entry. For more information about /etc/services, see z/OS V2R1.0 Communications Server: IP Configuration Reference and z/OS V2R1.0 Communications Server: New Function Summary. Note that, if tcp6 or udp6 is specified, the socket will support IPv6 (that is, AF_INET6 will be used.)

    sndbuf and rcvbuf specify the size of the send and receive buffers. The size may be in bytes, or a "k" or "m" may be added to indicate kilobytes or megabytes respectively. sndbug and rcvbuf can be used in either order.

    wait_flag [.max] Wait or nowait. Wait indicates the daemon is single-threaded and another request will not be serviced until the first one completes.

    If nowait is specified, the inet daemon issues an accept when a connect request is received on a stream socket. If wait is specified, the inet daemon does not issue the accept. It is the responsibility of the server to issue the accept if this is a stream socket.

    max is the maximum number of users allowed to request service in a 60 second interval. Default is 40. If exceeded, the service's port is shut down.

    login_name User ID and group that the forked daemon is to execute under. inetd can run a program with a UID that is not 0. However, if the program that inetd runs needs to change the identity of the process to that of the user, then the login_name must have been defined to RACF® via ADDUSER as a superuser with a UID of 0 (UID 0) and the login_name must have been defined to RACF. This will allow inetd to use special functions like setgid() and setuid().
    If the program that will be invoked by inetd requires the use of special functions like setuid() and seteuid(), then it must be permitted to the BPX.DAEMON class as in the following example for login, which is a typical ADDUSER command.
    ADDUSER rlogind omvs(uid(0) home(/)
    A typical permit command is:
    permit bpx.daemon class(facility)
       id(rlogind) access(read)

    How you set up security for daemons is the final determining factor. For more information, see the topic on establishing the correct level of security for daemons in z/OS UNIX System Services Planning.

    server_program Full path name of the service. For example:
    /usr/sbin/rlogind
    is the full path name for the rlogind command.
    Start of changeserver_argumentsEnd of change Start of changeMaximum of 20 arguments. The first argument is the server name and must be provided. Additional arguments are optional.End of change

Related information

The inetd daemon creates a temporary file, /etc/inetd.pid, that contains the PID of the currently executing inetd daemon. This PID value is used to identify syslog records that originated from the inetd daemon process, and also to provide the PID value for commands such as kill that require you to specify a PID, and to provide a lock to prevent more than one inetd from being active at one time.

For more information about setting up the inetd configuration file and configuring daemons in general, see the topic on daemons in z/OS UNIX System Services Planning or z/OS V2R1.0 Communications Server: IP Configuration Reference.