YPFILES(5) — FILE FORMATS
NAME
ypfiles − the yellowpages database and directory structure
DESCRIPTION
ypfiles.5:.IX "ypfiles file" "" "ypfiles — yellowpages database and directory"
The yellow pages (YP) network service uses a database of dbm(3X) files in the directory hierarchy at /etc/yp. Each YP domain is a subdirectory of /etc/yp. Domain yp_private must be present: it contains information about other domains. Any number of other domains may exist.
Every domain directory must contain 3 databases: ypservers, ypmaps, and hosts.byname. In addition, the domain yp_private must contain the database ypdomains. No other databases are required by the YP itself, although others may be required for the normal operation of the operating system or the NFS.
When setting up a new domain on a YP server machine, the domain directory should be created in /etc/yp manually. The required dbm files should be generated and placed in the new directory if the host is the master server for those maps, or copied from the master host’s database if the local machine is not the master for those maps. The YP database can be set up for the simple case where one YP server is the master for all maps by using ypinit(8).
A description of the required databases follows, following a short description of what makes a valid dbm database file as far as the YP is concerned. A dbm database consists of two files, one with the filename extension .pag and one with the filename extension .dir. These two files are created by calls to the dbm library package. Thus the database ypservers will be implemented by the pair of files ypservers.pag and ypservers.dir. Any dbm database which is to be used by the YP must contain a distinguished key-value pair: the key is the ASCII characters YP_LAST_MODIFIED with length 16, and the value should be a 10 character ASCII order number. The order number should be generated by calling gettimeofday(2) at the point the database is created, and using the seconds field value returned from that call. Database files which are also legal YP databases will be called YP maps. The low-level tool used to create valid YP maps is makedbm(8). The middle-level tool to build particular YP maps is /etc/yp/make, described in ypmake(8). A high-level tool to initialize the YP directory structure and get the required maps and the normally present maps into that directory structure is ypinit(8), mentioned above.
This section describes the format for ypdomains, ypservers, and ypmaps.
Ypdomains contains the set of all legal domain names. It must include the domain yp_private. It should also contain the domain names returned to client and server machines from the domainname(8) command. The keys in the map are assumed to be the domain names, and the values are not used by the YP. They may be null, or may be used as comments. Ypdomains must exist in domain yp_private, but need not exist in any other domain.
Ypservers contains the list of host names for all machines that should be running ypserv(8). The structure is the same as for ypservers: the keys within the map are assumed to be the host names, and the values are not used by the YP. ypservers must exist in every domain.
Ypmaps contains the list of all maps supported within a domain. Thus it will include entries for ypservers, hosts.byname, and ypmaps itself. The keys are assumed to be the names of the maps, and the values are assumed to be the hostname of the machine running the master ypserv. Each host referred to within ypmaps should have an entry in ypservers, and an entry in hosts.byname. Ypmaps must exist in every domain.
The ypwhich(8) command tells what machine is the YP server. There are tools to examine and change the YP database: yppush, yppull, yppoll, (all described in yppush(8)), ypcat(1), makedbm(8), and ypmake(8). The command rpcinfo(8) determines if a ypserv or ypbind process is up and running on a particular host.
SEE ALSO
makedbm(8), ypinit(8), ypmake(8), yppush(8), ypserv(8), rpcinfo(8)
Sun Release 2.0 — Last change: 1 February 1985