Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ypcat(1yp)

ypmatch(1yp)

ypwhich(1yp)

ypclnt(3yp)

ypfiles(5yp)

yppush(8yp)

ypxfr(8yp)

ypserv(8yp)

Name

ypserv, ypbind − Yellow Pages server and binder processes

Syntax

/usr/etc/ypserv
/etc/ypbind [ −S ] domainname, servername

Description

The Yellow Pages (YP) service provides a network lookup service consisting of databases and processes.  The databases are dbm(3x) files stored in the /etc/ypdirectory. These files are described in ypfiles(5yp). The processes are /usr/etc/ypserv, the YP database lookup server, and /etc/ypbind, the YP binder. The software interface to the YP service is described in ypclnt(3yp). Administrative tools are described in yppush(8yp), ypxfr(8yp), yppoll(8yp), and ypwhich(1yp). Tools to see the contents of YP maps are described in ypcat(1yp), and ypmatch(1yp). Database generation and maintenance tools are described in ypmake(8yp), and makedbm(8yp).

Both ypserv and ypbind are daemon processes activated at system startup time from /etc/rc.local. The ypserv command runs only on a YP server machine with a complete YP database. The ypbind command runs on all machines using YP services, both YP servers and clients.

The ypserv daemon’s primary function is to look up information in its local database of YP maps. The operations performed by ypserv are defined for the programmer in the header file <rpcsvc/yp_prot.h>.

Communication with ypserv is by means of RPC calls.  Lookup functions are described in ypclnt(3yp), and are supplied as C-callable functions in /lib/libc.

There are four lookup functions, all of which are performed on a specified map within a YP domain: Match, Get_first, Get_next, and Get_all. The Match operation takes a key, and returns the associated value. The Get_first operation returns the first key-value pair from the map, and the Get_next operation returns the remaining key-value pairs. The Get_all operation ships the entire map to the requester.

Two other functions supply information about the map, rather than the map entries: Get_order_number, and Get_master_name. Both the order number and the master name exist in the map as key-value pairs, but the server will not return either through the usual lookup functions.  If the map is examined with makedbm(8yp), 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: the Do_you_serve_this_domain?, the Transfer_map, and the Reinitialize_internal_state functions.

The purpose of the ypbind function is to remember information that lets client processes on a single node communicate with a ypserv process. The ypbind function must run on every machine that has YP client service requirements.  The ypbind function must be started via an entry in the /etc/rc.local file. The −S option allows the system administrator to lock ypbind to a particular domain and set of servers. Up to four servers can be specified as follows:

/etc/ypbind -S domainname,server1,server2,server3,server4

The ypserv function may or may not be running on the same node, but must be running somewhere on the network. The servers used with the −S option must have entries in the local /etc/hosts file.

The information ypbind remembers is called a binding, the association of a domain name with the internet address of the YP server, and the port on that host at which the 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 ypbind process broadcasts on the net trying to find a ypserv process that serves maps within that domain.  Since the binding is established by broadcasting, there must be at least one ypserv process on every net.  Once a domain is bound by a particular ypbind, that same binding is given to every client process on the node. The ypbind process on the local node or a remote node may be queried for the binding of a particular domain by using the ypwhich(1yp) command.

Bindings are verified before they are given out to a client process.  If ypbind is unable to speak to the ypserv 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 fail immediately. In general, a bound domain is marked as unbound when the node running ypserv crashes or gets overloaded.  When the node gets overloaded, ypbind will try to bind any YP server (typically one that is less-heavily loaded) available on the net.

The ypbind process also accepts requests to set its binding for a particular domain.  The request is usually generated by the YP subsystem itself.

Files

If the file /var/yp/ypserv.log exists when ypserv starts up, log information will be written to ypserv.log when error conditions occur.

See Also

ypcat(1yp), ypmatch(1yp), ypwhich(1yp), ypclnt(3yp), ypfiles(5yp), yppush(8yp), ypxfr(8yp)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026