/etc/inetd.conf این سرورها و پورتهای متداول را فهرست میکند. دستور inetd به تمام آنها گوش کرده؛ زمانی که برقرای ارتباط با پورتی را شناسایی کند، برنامه سرور مربوط به آن را اجرا میکند.
/etc/inetd.conf بیانگر یک سرور با هفت فیلد است (که با فاصله از هم جدا شدهاند)؛
/etc/services نگاشت شده است).
stream برای یک ارتباط TCP و dgram برای یک ارتباط UDP.
tcp, tcp6, udp, or udp6.
wait یا nowait که به inetd میگوید آیا برای اتمام فرآیند اجرا شده صبر کند یا خیر. برای ارتباطات TCP، معمولا میتوان از nowait استفاده کرد. برای برنامههایی که به UDP پاسخ میدهند، تنها زمانی از nowait باید استفاده کنید که سرور قادر به مدیریت چندین ارتباط به صورت همزمان باشد. میتوانید این فیلد را با استفاده از کاما پسوند کنید، به همراه حداکثر تعداد مجاز ارتباطات در دقیقه (حد پیشفرض برابر با ۲۵۶ است).
user.group syntax.
argv[0] در زبان C).
مثال 9.1. چکیدهای از /etc/inetd.conf
#:BSD: Shell, login, exec and talk are BSD protocols. talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd ntalk dgram udp wait nobody.tty /usr/sbin/in.ntalkd in.ntalkd #:INFO: Info services ident stream tcp nowait nobody /usr/sbin/nullidentd nullidentd finger stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/in.fingerd
tcpd program is frequently used in the /etc/inetd.conf file. It allows limiting incoming connections by applying access control rules, documented in the hosts_access(5) manual page, and which are configured in the /etc/hosts.allow and /etc/hosts.deny files. Once it has been determined that the connection is authorized, tcpd executes the real server (like in.fingerd in our example). It is worth noting that tcpd relies on the name under which it was invoked (that is the first argument, argv[0]) to identify the real program to run. So you should not start the arguments list with tcpd but with the program that must be wrapped.