generate and distribute YP
cd /var/yp; make
Makefile.yp utility generates or
updates the YP maps to be served by
Each YP domain to be served must have its own subdirectory below /var/yp. Use ypinit(8) to set up such subdirectories. In particular, ypinit(8) will copy /var/yp/Makefile.yp into each new domain subdirectory. For common configuration changes affecting all future domains, edit /var/yp/Makefile.yp before running ypinit(8). For configuration changes affecting only one individual domain, edit the Makefile in the respective domain subdirectory after running ypinit(8). Do not edit /var/yp/Makefile.yp.dist.
By default, input data for generating YP maps is collected from
the /etc directory. Edit the
DIR variable to choose a different source
To regenerate all maps for all domains, run make(1) in /var/yp. To regenerate all maps for one single domain, run make(1) in the respective domain subdirectory. The makedbm(8) utility will be used to create the maps in db(3) format, and they will be stored inside the appropriate domain subdirectory.
Whenever a YP map has been updated, it is automatically
distributed to all slave servers in the respective domain using the
yppush(8) utility. To disable automatic distribution, set the
NOPUSH variable to an arbitrary, non-empty,
STANDARD YP MAPS
Makefile.yp provides the
following make(1) targets:
- Generates the passwd.byname,
master.passwd.byuid maps from
master.passwd(5) for use by
The master.passwd.* maps always contain complete records in master.passwd(5) format, including the encrypted passwords.
The passwd.* maps follow the reduced passwd(5) format having the class, change, and expire fields removed but by default the encrypted passwords are included too. If the
UNSECUREvariable is changed to be empty, the encrypted passwords are replaced by asterisks (‘
*’). This “secure” mode is compatible with OpenBSD and FreeBSD clients.
MAXUIDvariables restrict the range of user IDs included into the four passwd maps. By default, system users are not included.
- Generates the netgroup, netgroup.byuser, and netgroup.byhost maps from netgroup(5) for use by getnetgrent(3) and passwd(5). Requires the revnetgroup(8) utility.
- Generates the group.byname and
group.bygid maps from
group(5) for use by
MAXGIDvariables restrict the range of group IDs included into both group maps. By default, system groups are not included.
- Generates the netid.byname map from netid(5), passwd(5), group(5), and hosts(5) for use by getgrouplist(3). Falls back to master.passwd(5) in case passwd(5) is not available. Requires the mknetid(8) utility.
- Generates the hosts.byname and
hosts.byaddr maps from
hosts(5) for use by
gethostbyname(3). Requires the
To get ypserv(8) to ask DNS for unknown hosts, set the
- Generates the ethers.byaddr and ethers.byname maps from ethers(5) for use by ethers(3). Requires the stdethers(8) utility.
- Generates the networks.byname and networks.byaddr maps from networks(5) for use by getnetent(3).
- Generates the rpc.bynumber map from rpc(5) for use by getrpcent(3).
- Generates the services.byname map from services(5) for use by getservent(3).
- Generates the protocols.byname and protocols.bynumber maps from protocols(5) for use by getprotoent(3).
- Generates the mail.aliases and
mail.byaddr maps from
aliases(5). This target uses both
sendmail(8) with the option
-biand the mkalias(8) utility.
- Generates the amd.home map from the file /etc/amd/amd.home.
- Generates all of the above, and sends a hangup signal to ypserv(8) such that it uses the new maps.
In order to keep additional custom YP maps up to date, the Makefile should be extended to support additional targets.
- Top level YP Makefile.
- Per domain YP maps Makefile.
- Database of hosts serving this domain.
- Database files containing the YP maps.
- Cookies controlling the operation of make(1).
make(1), db(3), makedbm(8), yp(8), ypinit(8), yppush(8), ypserv(8)
NOPUSH is set and individual maps are
regenerated (as opposed to
all), the hangup signal
to ypserv(8) must be sent manually, or the new maps won't be used.
NOPUSH is unset, maps are pushed to
the master server on the local host too, slowing down