Networking Service Daemons


This section provides a quick review of how networking services (as well as other services) are started in Fedora and RHEL. 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 from /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 and RHEL 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 sets whether or not the service is currently disabled. The following example is an excerpt from the /etc/xinetd.d/amanda file:

  service amanda   {   socket_type = dgram   protocol = udp   wait = yes   user = amanda   server = /usr/lib/amanda/amandad   disable = yes   }  

In this example, the amanda configuration file represents a means of retrieving backup index files from amanda clients . By default, the service is turned off. When the service is on, a request to the xinetd server daemon for the amandad service from the network is handed to the amandad 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/amanda 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 service 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 .

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 or RHEL are 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, the DNS ( named ), Samba ( smbd and nmbd ), and system logging ( syslogd ) services have options files in the /etc/sysconfig directory.




Fedora 6 and Red Hat Enterprise Linux Bible
Fedora 6 and Red Hat Enterprise Linux Bible
ISBN: 047008278X
EAN: 2147483647
Year: 2007
Pages: 279

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