Chapter 28 - Daemons

Download Report

Transcript Chapter 28 - Daemons

Daemons
Ying Zhang
CMSC691X, Summer02
Outline








Introduction
Init and Cron
System daemons
Print daemons and NFS daemons
Time synchronization daemons
Booting and configuration daemons
Internet daemons
Inetd
Introduction

Daemon


A background process that performs a
specific function or system-related task
Independent of kernel
Init




The primordial process
PID 1
Place the system in single-user
mode or spawns a shell to read the
systems’ startup scripts.
Define several “run levels” that
determine what set of system
resources should be enabled
Cron


Schedule commands
Mainly used for administrative
purposes



Management of accounting and log files
Daily cleanup of the file system
Backup of the file system
System daemons

The paging daemon





Part of the virtual memory system
Update the page into memory from the swap area
in the case of page faults
Write out pages to the swap device and update
page table if no physical pages are available
Pageout, vhand, kpiod, pagedaemon
The swapping daemon



Monitor the number of page faults that occur in
proportion to the number of memory reference
Move process out to swap space to avoid
“thrashing” if too many faults occur
Swapper, kswapd
System daemons (cont.)

The filesystem synchronization daemon
 Execute sync system call every 30
seconds


Cause all “dirty” block to be written out
Update, syncer, fsflush
Printing daemons and NFS daemons

Printing daemons


Provide printing-related service
NFS daemons





nfsd:
 Run on file servers and handle requests from NFS
client
mountd
 Accept filesystem mount requests from potential
NFS client
amd and automount
lockd and statd
biod
Time synchronization daemon

Timed



One or more machines are designated as time
masters
 Their clocks are considered authoritative
Other machines are slave
 Periodically converse with a master to learn
the time and then adjust their internal clock
Xntpd


Implement Network Time Protocol in RFC1119
Servers are arranged in a hierarchal tree
Booting and configuration daemons

bootp


tftpd


Map Ethernet address to IP address
bootparamd


Trivial file transfer server
rarpd


Boot server
Use /etc/bootparams to tell diskless clients where
to find their filesystems
dhcpd

Dynamic address assignment
Internet daemons







talkd: network chat service
comsat: notify users of new email
sendmail: transport electronic mail
snmpd: provide remote network
management service
rwhod: maintain remote user list
ftpd: file transfer server
poper: basic mailbox server
Internet daemons (cont.)








imapd: deluxe mailbox server
rlogind: remote login server
telnetd: another remote login server
sshd: secure remote login server
rshd: remote command execution server
rexecd: another command execution
server
rpc.exd: a third command execution
server
routed and gated
Internet daemons (cont.)




named: DNS server
syslogd: process log message
fingerd: look up users
httpd: WWW server
inetd

Overview



It is a daemon that manages other daemons
It attaches itself to network ports and starts up the
appropriate daemon when a connection occurs.
Configuring inetd


inetd consults a config file to determine which network
ports it should listen to
/etc/inetd.conf
Service
Name
Type of
socket
Protocol Multiple
Request
username
Full qualified name
and argument
ftp
stream
tcp
nowait
root
/usr/sbin/ftpd ftpd
mountd/1
dgram
rpc/udp
wait
root
/usr/sbin/mountd
mountd
inetd (cont.)

The services file


Map service numbers to port numbers
/etc/services
inetd (cont.)

Restarting inetd


Securing inetd


Have inetd to reread /etc/inetd.conf to put the
modification of this file into effect
 Send inetd a hangup signal
Enable only the services that you absolutely
need and turn everything else off
Portmap/rpcbind

Map RPC services to TCP and UDP port
Q?
Questions?