NFSv2/usr/man/man5/ypfiles.5

.\" @(#)ypfiles.5 1.2 85/04/04 SMI;
.TH YPFILES 5 "1 February 1985"
.SH NAME
ypfiles \- the yellowpages database and directory structure
.SH DESCRIPTION
ypfiles.5:.IX  "ypfiles file"  ""  "\fLypfiles\fP \(em yellowpages database and directory"
.PP
The yellow pages (YP) network service uses a database of
.IR dbm(3X)
files in the directory hierarchy at
.IR /etc/yp .
Each YP domain is a subdirectory of
.IR /etc/yp .
Domain
.I yp_private
must be present:
it contains information about other domains.
Any number of other domains may exist.
.PP
Every domain directory must contain 3 databases:
.IR ypservers ,
.IR ypmaps ,
and
.IR hosts.byname .
In addition, the domain
.I yp_private
must contain the database
.IR 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.
.PP
When setting up a new domain on a YP server machine,
the domain directory should be created in
.I /etc/yp
manually.
The required
.I 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
.IR ypinit (8).
.PP
A description of the required databases follows,
following a short description of what makes a valid
.I dbm
database file as far as the YP is concerned.
A
.I dbm
database consists of two files,
one with the filename extension
.I .pag
and one with the filename extension
.IR .dir .
These two files are created by calls to the
.I dbm
library package.
Thus the database
.I ypservers
will be implemented by the pair of files
.I ypservers.pag
and
.IR ypservers.dir .
Any
.I 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
.IR 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
.IR maps .
The low-level tool used to create valid YP maps is
.IR makedbm (8).
The middle-level tool to build particular YP maps is
.IR /etc/yp/make ,
described in
.IR 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
.IR ypinit (8),
mentioned above.
.PP
This section describes the format for
.IR ypdomains ,
.IR ypservers ,
and
.IR ypmaps .
.PP
.I Ypdomains
contains the set of all legal domain names.
It must include the domain
.IR yp_private .
It should also contain the domain names
returned to client and server machines from the
.IR 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.
.I Ypdomains
must exist in domain
.IR yp_private ,
but need not exist in any other domain.
.PP
.I Ypservers
contains the list of host names for all machines that should be running
.IR ypserv (8).
The structure is the same as for
.IR ypservers :
the keys within the map are assumed to be the host names,
and the values are not used by the YP.
.I ypservers
must exist in every domain.
.PP
.I Ypmaps
contains the list of all maps supported within a domain.
Thus it will include entries for
.IR ypservers ,
.IR hosts.byname ,
and
.I 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
.IR ypserv .
Each host referred to within
.I ypmaps
should have an entry in
.IR ypservers ,
and an entry in
.IR hosts.byname .
.I Ypmaps
must exist in every domain.
.PP
The
.IR ypwhich (8)
command tells what machine is the YP server.
There are tools to examine and change the YP database:
.IR yppush ,
.IR yppull ,
.IR yppoll ,
(all described in
.IR yppush (8)\|),
.IR ypcat (1),
.IR makedbm (8),
and
.IR ypmake (8).
The command
.IR rpcinfo (8)
determines if a
.I ypserv
or
.I ypbind
process is up and running on a particular host.
.SH "SEE ALSO"
makedbm(8), ypinit(8), ypmake(8), yppush(8), ypserv(8), rpcinfo(8)