Introduction

Introduction

Daemons are the invisible workhorses of the Linux world. A daemon is a program run in the background (i.e., not attached to any particular terminal) that performs some system task. Typically, that system task is to service a request by some user program for a piece of information (e.g., rwhod), access to some system resource (e.g., lpd), or to facilitate communication between two systems or two parts of the same system (e.g., telnetd, talkd).

The word "daemon" should be pronounced the same as "demon," but lots of people say "day-mon" or "die-mon" and no one laughs. In general, I try to stick with whichever pronunciation my boss prefers. The word originates in Greek mythology and refers to a supernatural agent somewhere above a human, but below a god in the order of things. Classical daemons are distinct from demons in that they are capable of both good and evil, which also fits in pretty well with my experience of the Linux variety.

By convention, the individual "d" at the end of each daemon name is pronounced, and people will look at you funny if you mess this up. For example, the program "named" is pronounced "name-dee."

If you are working with your system at the user level, you may go for months without having to mess with daemons. If you are managing a medium-sized or large network, you may do nothing else. Either way, the actual mechanics of configuring the various daemons are beyond the scope of this book.

graphics/tip.gif

Lots of times, configuration files are found in the /etc directory. If you're hunting a particular configuration file, you might try this:

 

ls -l /etc/*.conf | grep <yourcommand>

These days, most commercial Linux distributions configure the big daemons for you as part of the installation process. This is both good (configuring daemons can be an enormously complicated affair) and bad (if you don't have a feel for Linux daemonology, you'll never have a complete understanding of how your system works).

Daemons are usually started without human intervention. This usually happens in one of three ways:

         invoked by an rc script at boot time

         invoked by init at boot time

         invoked by the inetd daemon as needed, sometimes via tcpd

The examples in this chapter will reflect self-starting nature of daemons. In the case where the daemon might profitably be invoked by inetd, I'll give you a line to put in the inetd.conf file. Note that inetd relies on the /etc/services file for information about what ports to monitor for what service requests.

graphics/tip.gif

Obviously, the daemon programs may not be in the same place on your system as they are on mine. Before modifying your inetd.conf, do a sanity check on your program location.

 

An Internet port is a logical network connection associated with a particular service. Note that these are distinct from the actual physical ports into which you might plug a serial line. An Internet port is born when the network programmers of the world get together and decide that "thus-and-such" port number will be associated with "thus-and-such" service from now on. There's nothing special about the port numbers, just that everyone agrees on what they are and what they will stand for. The /etc/services file contains the port/service associations for your machine.

The ultimate aim of daemon configuration is to get them to a state where they start up and shut down as needed without any human intervention whatsoever. To this end, the inetd program (itself a daemon) has been created. Inetd monitors certain ports for Internet service requests and invokes the daemons associated with those ports as needed. To put a daemon under the control of inetd, you must add a line in specific format to the /etc/inetd.conf file for example,

service socket_type protocol wait user program arguments

where

         service is a network service defined in /etc/services.

         socket_type is one of (stream | dgram | raw | rdm | seqpacket).

         protocol is a valid protocol (e.g., tcp, udp) as specified in /etc/protocols.

         wait is either wait or nowait.

         user is the name of the user as whom the service is run.

         program specifies the program to be executed when inetd receives a request on the associated socket.

         arguments are the arguments associated with the program to be run.

The daemons described in this chapter are

fingerd

Services finger requests.

erd

Services finger requests.

ftpd

Services ftp requests.

gated

Handles network routing.

gdc

Program that controls gated.

identd

TCP/IP identification protocol.

imapd

Remote mail access.

inetd

Invokes other daemons, as necessary.

klogd

Kernel log daemon.

lpd

Services line printer requests.

mountd

NFS mount daemon.

named

Internet domain name service.

pppd

Handles point-to-point protocol communication.

rexecd

Remote command execution.

rlogin

Remote system login.

rcmd

Remote command execution.

rshd

Remote command execution.

rwhod

Services rwho/ruptime.

syslogd

System log daemon.

talk

Communication between two users.

tcpd

Access control for Internet services.

telnetd

Services telnet requests.

tftpd

Services tftp requests.

yppasswdd

Changes password.

 



Linux Desk Reference
Linux Desk Reference (2nd Edition)
ISBN: 0130619892
EAN: 2147483647
Year: 2000
Pages: 174
Authors: Scott Hawkins

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