4.3BSD-UWisc/man/man8/ypserv.8

Compare this file to the similar file:
Show the results in this format:

.\" @(#)ypserv.8 1.1 85/12/28 SMI; 
.TH YPSERV 8 "6 December 1985"
.SH NAME
ypserv \- yellow pages server and binder processes
.SH SYNOPSIS
.B /usr/etc/ypserv
.br
.B /etc/ypbind
.SH DESCRIPTION
.IX  "ypserv command"  ""  "\fLypserv\fP \(em yellow pages server process"
The yellow pages (YP) provides a simple network lookup service  
consisting of databases and processes.  The databases are
.IR dbm (3)
files in a directory tree rooted at
.IR /etc/yp .
These files are described in ypfiles(5).
The processes are
.IR /usr/etc/ypserv ,
the YP database lookup server, and
.IR /etc/ypbind ,
the YP binder.
The programmatic interface to YP is described in ypclnt(3N).
Administrative tools are described in
yppush(8),
ypxfr(8),
yppoll(8),
ypwhich(8),
and
ypset(8).
Tools to see the contents of YP maps are described in
ypcat(8),
and
ypmatch(1).
Database generation and maintenance tools are described in
ypinit(8),
ypmake(8),
and
makedbm(8).
.LP
Both
.I ypserv
and
.I ypbind
are daemon processes typically activated at system startup time from
.IR /etc/rc.local .
.I ypserv
runs only on YP server machines with a complete YP database.
.I ypbind
runs on all machines using YP services, both YP servers and clients.
.LP
The
.I ypserv
daemon's primary function is to look up information in its local 
database of YP maps.  The operations performed by
.I ypserv
are defined for the implementor by the
.IR "YP protocol specification" ,
and for the programmer by the header file \fL<rpcsvc/yp_prot.h>\fP.  
Communication to and from
.I ypserv
is by means of RPC calls.  Lookup functions are described in
ypclnt(3N),
and are supplied as C-callable funtions in
.IR /lib/libc .
There are four lookup functions, all of which are performed on a specified
map within some YP domain:
.IR Match ,
.IR "Get_first" ,
.IR "Get_next" ,
and
.IR "Get_all" .
The
.I Match
operation takes a key, and returns the associated value.
The
.I "Get_first"
operation returns the first key-value pair from the map, and
.I "Get_next"
can be used to enumerate the remainder.  
.I "Get_all"
ships the entire map to the requester as the response to a single RPC
request. 
.LP
Two other functions supply
information about the map, rather than map entries:
.IR "Get_order_number" ,
and
.IR "Get_master_name" .
In fact, both order number and master name exist in the map as key-value
pairs, but the server will not return either through the normal lookup
functions.  (If you examine the map with
.IR makedbm (8),
however, they will be visible.)  Other functions are used within the YP 
subsystem itself, and are not of general interest to YP clients.  They include  
.IR "Do_you_serve_this_domain?" ,
.IR "Transfer_map" ,
and
.IR "Reinitialize_internal_state" .
.LP
The function of 
.I ypbind
is to remember information that lets client processes on a single node
communicate with some
.I ypserv
process.
.I ypbind
must run on every machine which has YP client processes;
.I ypserv
may or may not be running on the same node, but must be running somewhere 
on the network.  
.LP
The information
.I ypbind
remembers is called a 
.I binding 
\(em the association of a domain name with
the internet address of the YP server, and the port on that host at 
which the
.I ypserv
process is listening for service requests.  The process of binding is 
driven
by client requests.  As a request for an unbound domain comes in, the
.I ypbind
process broadcasts on the net trying to find a
.I ypserv
process that serves maps within that domain.  Since the binding is 
established by broadcasting, there must be at least one
.I ypserv
process on every net.  Once a domain is bound by a particular
.IR ypbind ,
that same binding is given to every client process on the node.
The 
.I ypbind
process on the local node or a remote node may be queried for the 
binding of a particular domain by using the
.IR ypwhich (1)
command.
.LP
Bindings are verified before they are given out to a client process.  If
.I ypbind
is unable to speak to the
.I ypserv
process it's bound to, it marks the domain as unbound, tells the client
process that the domain is unbound, and tries to bind the domain
once again.  Requests received for an unbound domain will fail 
immediately.
In general, a bound domain is marked as unbound when the node
running 
.I ypserv
crashes or gets overloaded.  In such a case, 
.I ypbind
will to bind any YP server (typically 
one that is less-heavily loaded) available on the net.
.LP
.I ypbind
also accepts requests to set its binding for a particular domain.  The
request is usually generated by the YP subsystem itself.
.IR ypset (8)
is a command to access the 
.I "Set_domain"
facility.  It is for unsnarling messes, not for casual use.
.SH "FILES"
If the file 
.IR /usr/etc/yp/ypserv.log
exists when 
.I ypserv
starts up, log information will be written to this file when error
conditions arise.
.SH "SEE ALSO"
ypclnt(3N), ypfiles(5), ypcat(8), ypmatch(8), yppush(8), ypwhich(8),
ypxfr(8), ypset(8), YP protocol specification