Networking Service Daemons


This section provides a quick review of how networking services (as well as other services) are started in Fedora Linux. The two main directories containing files that define how services are started are /etc/xinetd.d and /etc/init.d.

  • /etc/xinetd.d contains configuration files used by the xinetd daemon.

  • /etc/init.d contains start-up scripts that are linked to /etc/rc?.d directories so they can be started at different run levels.

Each of these methods for handling network services is described in the following sections.

Note 

Some Fedora Linux configuration tools also store configuration information in the /etc/sysconfig directory. For example, there are configuration files for iptables and sendmail in /etc/sysconfig. If you search the scripts in the /etc/init.d directory for the word sysconfig, you will see just how many services look in that directory for configuration information.

The xinetd super-server

The xinetd daemon is referred to as the super-server. It listens for incoming requests for services based on information in separate files in the /etc/xinetd.d directory. When a request for a service is received by the xinetd daemon (for a particular network port number), xinetd typically launches a different daemon to handle the request. So instead of having separate daemons running for every network service, only the xinetd daemon needs to run — plus an additional daemon process for each service currently in use.

To see if a particular service handled by xinetd is on or off, go to the /etc/xinetd.d directory and open the file representing that service with a text editor. A default line at the top of the file indicates whether or not the service is on or off by default. The disable line actually sets whether or not the service is currently disabled. The following example is an excerpt from the /etc/xinetd.d/tftp file:

service tftp  {         socket_type      = dgram         protocol         = udp         wait             = yes         user             = root         server           = /usr/sbin/in.tftpd         server_args      = -s /tftpboot         disable          = yes         per_source       = 11         cps              = 100 2         flags            = IPv4  } 

In this example, the tftp configuration file represents the Trivial File Transfer Protocol (TFTP) service. By default, the service is turned off. When the service is on, a request to the xinetd server daemon for a tftp service from the network is handed to the /usr/sbin/in.tftpd daemon. The in.tftpd daemon, in turn, handles the remote user’s request for file transfer service from this Linux system that is acting as a TFTP server. Other entries in this file contain options that are passed to the TFTP daemon.

To enable a service in an /etc/xinetd.d file, edit the file using any text editor as the root user. Turning on the service is as easy as changing the disable option from yes to no and restarting the xinetd daemon. For example, you could change the line in the /etc/xinetd.d/tftp so that it appears as follows:

disable = no  

Then you could restart the xinetd daemon (without turning off the daemon itself):

# service xinetd restart 
Note 

Although not all services support this, the xinetd services lets you use the reload instead of the restart option with the service command just shown. With xinitd already running, a reload can occur faster and with less interruption to system services by not completely shutting down xinetd.

In this case, you could look in the /etc/services file and see that tftp services are (by default) received on port number 69 for TCP/IP and UDP networks. So, any request that comes into your computer for port 69 is first directed to the xinetd daemon, then handled by the tftpd daemon. If authentication is correct, the requested file transfer can take place.

Cross-reference: 

The xinetd super-server is described in Chapter 12.

The init.d start-up scripts

Network services that are not available via the xinetd daemon are typically handled by scripts in the /etc/init.d directory. For a script in the /etc/init.d directory to activate a service, it must be linked to a file in one of the run-level directories (/etc/rc?.d) that begins with the letter S followed by a two-digit number.

For example, the script for starting the print service daemon (/etc/init.d/cups) is linked to the file S55cups in the /etc/rc2.d, /etc/rc3.d, /etc/rc4.d, and /etc/rc5.d directories. In that way, the print service is started when Fedora Linux is running in initialization states 2, 3, 4, or 5.

Cross-reference: 

See Chapter 12 for more details on run levels and start-up scripts.

For the most part, system administrators are not expected to modify these start-up scripts. However, to have a service turned on or off for a particular run level, change the script to a filename that begins with an S (start) to one that begins with a K (kill). You can easily do this with the chkconfig command or the Service Configuration window. To start that window, type serviceconf from a Terminal window while you are logged in as the root user.

Start-up scripts typically start one or more daemon processes that represent a particular service. To add options to a particular daemon, you typically don’t have to edit the start-up script directly. Instead, look for configuration files in the /etc/sysconfig directory. For example, daemons options representing the DNS (named), Samba (smbd and nmbd), and system logging (syslogd) services have options files in the /etc/sysconfig directory.




Red Hat Fedora Linux 3 Bible
Red Hat Fedora Linux 3 Bible
ISBN: 0764578723
EAN: 2147483647
Year: 2005
Pages: 286

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net