Network Information Service (NIS) B.11.31.02 Administrator's Guide
3. Enter the following commands to generate the map and to push it to the slave servers:
cd /var/yp
/usr/ccs/bin/make mapname
If the slave servers are not running, enter the following command with the NOPUSH flag set
to 1, as follows:
cd /var/yp
/usr/ccs/bin/make NOPUSH=1 mapname
This procedure is effective for all NIS maps except the ypservers map, which does not have a
source file. For information about modifying the ypservers map, see “Adding a Slave Server
to the NIS Domain” (page 30) or “Removing a Slave Server from the NIS Domain” (page 31).
If you modify the passwd, group, or hosts map, you must regenerate the netid.byname
map using the make hosts and make netid commands. However, it is not mandatory to use
the make hosts command before rebuilding the netid maps using the make netid command.
The netid.byname map maps the users to groups, where the entry for each user is followed
by a list of all the groups to which the user belongs. The netid.byname map is generated from
the /etc/passwd, /etc/group, and /etc/hosts files.
For more information, see make(1), ypmake(1M), yppush(1M), and ypxfr(1M).
Adding an AutoFS Map to the NIS Domain
AutoFS mounts directories automatically when users or processes request access to them. It
unmounts directories automatically if the processes remain idle for more than 10 minutes. By
default, an NIS domain that you set up contains an auto.master AutoFS map file.
To add an AutoFS map to the NIS domain, for example auto.tools, complete the following steps:
1. Log in to the NIS master server as superuser.
2. Modify the /usr/sbin/ypinit script using a text editor, to add the AutoFS map to the
MASTER_MAPS list variable, as follows:
MASTER_MAPS=”group.bygid group.byname \
hosts.byaddr hosts.byname netgroup netgroup.byhost \
netgroup.byuser networks.byaddr networks.byname passwd.byname \
passwd.byuid protocols.byname protocols.bynumber rpc.bynumber \
services.byname vhe_list publickey.byname netid.byname mail.byaddr \
mail.aliases auto.master rpc.byname servi.bynp auto.tools”
3. Modify the /var/yp/Makefile file, as follows:
• Add the AutoFS map to the list of maps that begin with all:, as follows:
all: passwd group hosts networks rpc services protocols \
netgroup aliases publickey netid vhe_list auto.master\
auto.tools
• Duplicate the section that begins with $(YPDBDIR)/$(DOM)/auto_master.time.In
this section, change all occurrences of auto.master or auto_master in the newly
created section to the name of the map that you are adding. Ensure that some occurrences
are auto_tools (the name of the ASCII file), and some are auto.tools (the name
of the NIS database).
$ (YPDBDIR)/$(DOM)/auto_tools.time: $(DIR)/auto_tools\
@(sed -e ”s/^[ | ]*//g” -e ”/^#/d” -e s/#.*$$//
$(DIR)/auto_tools $(CHKPIPE)) |\
$(MAKEDBM) - $(YPDBDIR) /$(DOM)/auto.tools;
@touch $(YPDBDIR)/$(DOM)/auto_tools.time;
@echo ”updated auto.tools”;
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM)\ auto.tools; fi
@if [ ! $(NOPUSH) ]; then echo ”pushed\ auto.tools”; fi
In the /var/yp/Makefile file, duplicate the section that begins with auto.master:.
In this section, change auto.master to auto.tools, and change both occurrences
of auto_master.time to auto_tools.time.
Adding an AutoFS Map to the NIS Domain 29