world leader in high performance signal processing
Trace: » inetd

What is inetd ?

This is a user code program that sets up and monitors a number of ports on a system.

When an external system tries to establish communications with such a system it first contacts the inetd manager program. This manager program can then redirect the network traffic to a special handler program designated for the specific network port.

The task of linking ports to programs is conducted by a configuration file /etc/inetd.conf.

Typical contents

# on the target system

root:~> cat /etc/inetd.conf
ftp     stream tcp nowait root /bin/ftpd -l
telnet  stream tcp nowait root /bin/telnetd

The service is designated by name so you also need a file /etc/services to link the service name to the port and protocol.

oot:~> cat /etc/services
ftp     21/tcp
ftp     21/udp
ssh     22/tcp
ssh     22/udp
telnet  23/tcp
telnet  23/udp
nameserver      42/tcp  name
nameserver      42/udp  name
tftp    69/tcp
tftp    69/udp
finger  79/tcp
finger  79/udp
http    80/tcp  www www-http
http    80/udp  www www-http
kerberos        88/tcp  kerberos5 krb5
kerberos        88/udp  kerberos5 krb5
hostname        101/tcp hostnames
hostname        101/udp hostnames
shell   514/tcp cmd
shell   514/udp cmd

The /etc/inetd.conf file is often generated automatically during the system build.

The user/telnetd/Makefile shows this process.

During the make romfs part of the system build the correct entry is made into the /etc/inetd.conf file.

 romfs:
        $(ROMFSINST) /bin/$(EXEC)
        $(ROMFSINST) -e CONFIG_USER_TELNETD_TELNETD \
                -a "telnet  stream tcp nowait root /bin/telnetd" /etc/inetd.conf