'\"macro stdmacro
.if n .pH g1a.ypserv @(#)ypserv	40.3 of 1/29/90
.\" Copyright 1989 AT&T
.\" @(#)ypserv.8 1.9 89/09/28 SMI;
.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
.nr X
.if \nX=0 .ds x} ypserv 1M "" "\&"
.if \nX=1 .ds x} ypserv 1M ""
.if \nX=2 .ds x} ypserv 1M "" "\&"
.if \nX=3 .ds x} ypserv "" "" "\&"
.TH \*(x}
.SH NAME
\f4ypserv\fP, \f4ypbind\fP \- YP server and binder processes
.SH SYNOPSIS
\f4/usr/lib/netsvc/yp/ypserv\fR
.P
\f4/usr/lib/netsvc/yp/ypbind\fR
[
\f4\-ypset \fR\||\|\f4\-ypsetme\fR
]
.SH DESCRIPTION
.P
The \s-1YP\s0 provides a simple network lookup service
consisting of databases and processes.
The databases are
\f4dbm\fR(3)
files in a directory tree rooted at
\f4/var/yp\fR.
These files are described in
\f4ypfiles\fR(4).
The processes are
\f4/usr/sbin/ypserv\fR,
the YP database lookup server, and
\f4/usr/sbin/ypbind\fR,
the
\s-1YP\s0
binder.
The programmatic interface to
\s-1YP\s0
is described in
\f4ypclnt\fR(3N).
Administrative tools are described in
\f4yppush\fR(1M),
\f4ypxfr\fR(1M),
\f4yppoll\fR(1M),
\f4ypwhich\fR(1),
and
\f4ypset\fR(1M).
Tools to see the contents of
\s-1YP\s0
maps are described in
\f4ypcat\fR(1),
and
\f4ypmatch\fR(1).
Database generation and maintenance tools are described in
\f4ypinit\fR(1M),
\f4ypmake\fR(1M),
and
\f4makedbm\fR(1M).
.P
Both
\f4ypserv\fR
and
\f4ypbind\fR
are daemon processes typically activated at system startup time from
\f4/etc/rc.local\fR.
\f4ypserv\fR
runs only on
\s-1YP\s0
server machines with a complete
\s-1YP\s0
database.
\f4ypbind\fR
runs on all machines using
\s-1YP\s0
services, both
\s-1YP\s0
servers and clients.
.P
The
\f4ypserv\fR
daemon's primary function is to look up information in its local
database of
\s-1YP\s0
maps.
Communication to and from
\f4ypserv\fR
is by means of
\s-1RPC\s0
calls.
Lookup functions are described in
\f4ypclnt\fR(3N),
and are supplied as C-callable functions in the
\s-1YP\s0
library.
There are four lookup functions, all of
which are performed on a specified
map within some
\s-1YP\s0
domain:
\f2Match\fR,
\f2"Get_first"\fR,
\f2"Get_next"\fR,
and
\f2"Get_all"\fR.
The
\f2Match\fR
operation takes a key, and returns the associated value.
The
\f2"Get_first"\fR
operation returns the first key-value pair from the map, and
\f2"Get_next"\fR
can be used to enumerate the remainder.
\f2"Get_all"\fR
ships the entire map to the requester as the response to a single
\s-1RPC\s0
request.
.P
Two other functions supply
information about the map, rather than map entries:
\f2"Get_order_number"\fR,
and
\f2"Get_master_name"\fR.
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
\f4makedbm\fR(1M),
however, they will be visible.
.P
The function of
\f4ypbind\fR
is to remember information that lets client
processes on a single node communicate with some
\f4ypserv\fR
process.
\f4ypbind\fR
must run on every machine which has
\s-1YP\s0
client processes;
\f4ypserv\fR
may or may not be running on the same node,
but must be running somewhere on the network.
.P
The information
\f4ypbind\fR
remembers is called a
\f2binding\fR
\(em the association of a domain name with a
\s-1YP\s0
server.
.P
The process of binding is driven by client requests.
As a request for an unbound domain comes in, the
\f4ypbind\fR
process steps through the
\f4ypservers\fR
list (last entry first)
trying to find a
\f4ypserv\fR
process that serves maps within that domain.
There must be a
\f4ypserv\fR
process on at least one of the hosts in the
\f4ypservers\fR
file.
Once a domain is bound by a particular
\f4ypbind\fR,
that same binding is given to every client process
on the node.
The
\f4ypbind\fR
process on the local node or a\p
.NE 3
remote node may
be queried for the binding of a particular
domain by using the
\f4ypwhich\fR(1)
command.
.P
If
\f4ypbind\fR
is unable to speak to the
\f4ypserv\fR
process it is 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
wait until the domain requested is bound.
In general, a bound domain is marked as unbound when the node
running
\f4ypserv\fR
crashes or gets overloaded.
In such a case,
\f4ypbind\fR
will to bind another
\s-1YP\s0
server 
listed in
\f4/var/yp/binding/\f2domainname\f4/ypservers\fR.
.P
\f4ypbind\fR
also accepts requests to set its binding for a particular domain. 
The request is usually generated by the
\s-1YP\s0
subsystem itself.
\f4ypset\fR(1M)
is a command to access the
\f2"Set_domain"\fR
facility.
Note: the 
\f2Set Domain\fR
procedure only accepts requests from processes
running as root, ant the
\f4\-ypset\fR
or 
\f4\-ypsetme\fR
flags must have been set for
\f4ypbind\fR.
.P
The following options are available for the
\f4ypbind\fR
command only:
.TP 12
\f4\-ypset\fR
Allow any user to call
\f4ypset\fR(1M).
By default, no one can call
\f4ypset\fR(1M).
.TP
\f4\-ypsetme\fR
Only allow
\f4root\fR
on local machines to call
\f4ypset\fR(1M).
By default, no one can call
\f4ypset\fR(1M).
.SH FILES
.P
If the file
\f4/var/yp/ypserv.log\fR
exists when
\f4ypserv\fR
starts up, log information will be written to this file when error
conditions arise.
.PD 0
.TP 20
\f4/var/yp\fR
.TP
\f4/var/yp/binding/\f2ypdomain\f4/ypservers\fR
.PD
.SH "SEE ALSO"
\f4makedbm\fR(1M),
\f4ypcat\fR(1),
\f4ypinit\fR(1M),
\f4ypmake\fR(1M),
\f4ypmatch\fR(1),
\f4yppoll\fR(1M),
\f4yppush\fR(1M),
\f4ypset\fR(1M),
\f4ypwhich\fR(1),
\f4ypxfr\fR(1M),
\f4dbm\fR(3X),
\f4ypclnt\fR(3N),
\f4ypfiles\fR(4)
.SH NOTES
.P
Both 
\f4ypbind\fR
and
\f4ypserv\fR
support multiple domains.
The 
\f4ypserv\fR
process determines the domains it serves by looking for directories of the 
same name in the directory
\f4/var/yp\fR.
Additionally, the 
\f4ypbind\fR
process can maintain bindings to several domains
and their servers.
