ypmake(1M) ypmake(1M)
NAME
ypmake: make - create files for the network information service
SYNOPSIS
cd /var/yp; make [NOPUSH=1] [mname]
DESCRIPTION
If the make(1) command is issued in the directory /var/yp, it gen-
erates the standard Network Information Service files in dbm format
from existing ASCII files.
The command can be used, for example, if a normal ASCII file contains
information that you would like to make accessible to all the hosts in
a domain (e.g. the /etc/passwd file with the global user names).
In the menu system, this command is called automatically if changes
are made to NIS files.
If the make command is used on the Network Information Service files,
conversion parameters and command calls [e.g. makedbm(1M)] are
required which are stored in Makefile in the directory /var/yp.
In order to make changes to NIS files with make, these changes must
first be entered in the corresponding ASCII files.
Page 1 Reliant UNIX 5.44 Printed 11/98
ypmake(1M) ypmake(1M)
Excerpt from the file /var/yp/Makefile:
#
..........
#
SHELL=/usr/bin/ksh
DOM = 'domainname'
NOPUSH = " "
YPDIR =/usr/sbin
YPDBDIR=/var/yp
ALIASFILE=$(APDBDIR)/aliases
YPPUSH=$(YPDIR)/yppush
MAKEDBM=/usr/sbin/makedbm
ALIAS=$(YPDIR)/ypalias
STDHOSTS=$(YPDBDIR)/stdhosts
REVNETGROUP=$(YPDBDIR)/revnetgtoup
PASSWD=/etc/yppasswd
GROUP=/etc/ypgroup
ALIASES=/usr/lib/aliases
YPSERVERS=/var/yp/ypservers
NETGROUP=/var/yp/netgroup
HOSTS=/etc/inet/hosts
SERVICES=/etc/inet/services
PROTOCOLS=/etc/int/protocols
NETWORKS=etc/inet/networks
RPC=/etc/rpc
ETHERS=/etc/ethers
MAIL=/var/yp/mail.aliases
TIMED=/etc/inet/timed
all: ypservers rest
rest: passwd group networksk netgroup protocols\
services rpc mail
setup:
@echo passwd.byname '$(ALIAS) passwd.byname' >> $(ALIASFILE);
@echo passwd.byuid '$(ALIAS) passwd.byuid' >> $(ALIASFILE);
@echo group.byname '$(ALIAS) group.byname' >> $(ALIASFILE);
@echo group.byuid '$(ALIAS) group.byuid' >> $(ALIASFILE);
@echo hosts.byname '$(ALIAS) hosts.byname' >> $(ALIASFILE);
@echo hosts.byaddr '$(ALIAS) hosts.byaddr' >> $(ALIASFILE);
@echo networks.byname '$(ALIAS) networks.byname' >> $(ALIASFILE);
@echo networks.byaddr '$(ALIAS) networks.byaddr' >> $(ALIASFILE);
@echo netgroup.byuser '$(ALIAS) netgroup.byuse' >> $(ALIASFILE);
@echo netgroup.byhost '$(ALIAS) netgroup.byhost' >> $(ALIASFILE);
@echo protocols.byname '$(ALIAS) protocols.byname' >> $(ALIASFILE);
@echo protocols.bynumber '$(ALIAS) protocols.bynumber' >> $(ALIASFILE);
@echo services.byname '$(ALIAS) services.byname' >> $(ALIASFILE);
@echo services.byport '$(ALIAS) services.byport' >> $(ALIASFILE);
@echo rpc.byname '$(ALIAS) rpc.byname' >> $(ALIASFILE);
Page 2 Reliant UNIX 5.44 Printed 11/98
ypmake(1M) ypmake(1M)
@echo rpc.bynumber '$(ALIAS) rpc.bynumber' >> $(ALIASFILE);
@echo ypservers '$(ALIAS) ypservers' >> $(ALIASFILE);
@echo timed '$(ALIAS) timed' >> $(ALIASFILE);
@echo $(ALIASFILE) | uniq > .ypaliases; mv .ypaliases >> $(ALIASFILE);
@echo "setup of /var/yp/aliases"
passwd: passwd.push
passwd.push: passwd.time
-@if [ ! "$(NOPUSH)" -a -f $(PASSWD) }: then \
$(YPPUSH) passwd.byname; \
$(YPPUSH) passwd.byuid; \
/var/yp/map2system passwd; \
touch $@; echo "pushed $(@:.push+)"; \
fi
passwd.time: $(PASSWD)
-@if { -f $(PASSWD) ]; then \
domain=$(DOM);\
awk 'BEGIN {FS="="; OFS="\
/[a-zA-Z0-9]/ { print $$1, $$0}' \
$(PASSWD) \
$(MAKEDBM) - $(YPDBDIR)/'$(ALIAS) -d $$domain'/'$(ALIAS)passwd.byname'; \
awk 'BEGIN {fs=":"; ofs="\\T"; } \
/[a-zA-Z0-9]/ { print $$3, $$0 }' \
$(PASSWD) \
$(MAKEDBM) - $(YPDBDIR)/Q$(ALIAS) -d $$domainQ/Q$(ALIAS) passwd.byuid'; \
touch $@; echo "updated $(@:.time=)"; \
else \
echo "source of map $(@:.time=) not found; map not done"; \
fi
.
.
An appropriate entry must exist in Makefile for each ASCII file that
is to be made accessible to the Network Information Service.
The make command executes the instructions that are entered in the
file Makefile. The NIS files generated in this manner are automati-
cally copied to the slaves with the yppush(1M) command.
OPTIONS
no argument specified:
The command generates files for the Network Information Service
from all the modified ASCII files entered in Makefile. The files
are automatically copied to the slaves.
NOPUSH=1
yppush will not be executed.
mname
Name of an ASCII file that is to be made accessible to the Net-
work Information Service.
Page 3 Reliant UNIX 5.44 Printed 11/98
ypmake(1M) ypmake(1M)
EXAMPLE
Changes made to the ASCII file /etc/yppasswd on the master are to be
made accessible to the Network Information Service.
cd /var/yp; make passwd
The system responds by displaying the following:
updated passwd pushed passwd
SEE ALSO
make(1), makedbm(1M), yppush(1M).
Page 4 Reliant UNIX 5.44 Printed 11/98