ypfiles.4 (2010 09)

y
ypfiles(4) ypfiles(4)
NAME
ypfiles - Network Information Service database and directory structure
DESCRIPTION
Note : The Network Information Service (NIS) was formerly known as Yellow Pages (YP). Although
the name has changed, the functionality of the service remains the same.
The Network Information Service (NIS) network lookup service uses databases in the directory hierarchy
under /var/yp. These databases exist only on machines that act as NIS servers. A database consists of
two files created by makedbm (see makedbm(1M)). One has the filename extension
.pag and the other
has the filename extension
.dir. For example, the database named
netgroup is implemented by the
pair of files
netgroup.pag and netgroup.dir. A database served by the NIS is called an NIS map.
An NIS domain is a named set of Network Information Service maps. Each NIS domain is implemented
as a subdirectory of
/var/yp (whose name is the domain name) and contains the maps for that domain.
Any number of NIS domains can exist, and each can contain any number of maps.
Besides the databases contained in
/var/yp/domain
, master NIS servers have files named
general_NIS_mapname.time that reside there, too. These files are merely empty files whose times of
last modification are compared with those of the ASCII files from which the maps are built. The
ypmake
script performs these comparisons to determine whether the maps are current (see ypmake (1M)). The
general_NIS_mapname designation is described further in the FILES section below.
The NIS lookup service does not require maps, although maps may be required for the normal operation
of other parts of the system. The list of maps an NIS server provides access to is neither restricted nor
must it be all-inclusive. If a map exists in a given domain and a client asks about it, the NIS serves it.
For a map to be consistently accessible, it must exist on all NIS servers that serve the domain. To provide
data uniformity between the replicated maps, make an entry to run
ypxfr periodically in root’s
cron-
tab file on each server (see ypxfr (1M) and crontab (1)). More information on this topic is in yppush (1M)
and ypxfr (1M).
NIS maps contain two special key-value pairs. The first key, NIS_LAST_MODIFIED, has a 10-character
(ASCII) order number as a value. The order number is the
time() in seconds when the map was built
(see time (2)). The second key is NIS_MASTER_NAME, whose value is the host name of the map’s master
NIS server. The
makedbm command generates both key-value pairs automatically. The
ypxfr com-
mand uses these values when it transfers a map from one NIS server to another.
Generate and modify NIS maps only on the master server. They are copied to the slaves using
ypxfr to
avoid potential byte-ordering problems among NIS servers running on machines with different architec-
tures, and to minimize the disk space required for the databases (see ypxfr (1M)). NIS databases can be
created initially for both masters and slaves by using
ypinit (see ypinit (1M)).
After servers databases are created, the contents of some maps will change. Generally, an ASCII source
version of each database exists on the master, and is changed with a text editor. The NIS map is rebuilt
to include the changes, and propagated from the master to the slaves by running the
ypmake
shell script
(see ypmake (1M)).
All standard NIS maps are built by commands contained in the
ypmake script or the NIS Makefile.
If you add a non-standard NIS map, edit the ypmake script or Makefile to support the new map
(standard NIS maps are discussed under FILES below). ypmake and Makefile use makedbm to
generate the NIS maps on the master and may run yppush to copy the rebuilt maps to the slaves (see
yppush (1M)). The yppush command reads the map named ypservers that contains the host names
of all NIS servers for the specific domain. For more information, see ypmake(1M), yppush (1M), and
ypxfr (1M).
Standard nicknames are defined in the file
/var/yp/nicknames. These names can be used in place of
the full map name in the ypmatch and ypcat commands. Use the ypwhich -x command to display
the current set of nicknames. Use the ypwhich -m command to display all the available maps. Each
line of the nickname file contains two fields separated by white space. The first field is the nickname, and
the second field is the name of the map that it expands to. The nickname cannot contain a period (.).
DEPENDENCIES
If
/var/yp is in a file system that does not allow file names longer than 14 characters and you want to
create a new non-standard map for the Network Information Service, its name must not exceed 10 char-
acters in length. This rule exists because makedbm adds the 4-character sufxes .dir and .pag to
any mapname.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)