Network Information Service (NIS) B.11.31.02 Administrator's Guide

To receive map updates from the NIS master server, you must add the new slave server to the
ypservers map on the master server. For information about adding an NIS slave server to the
NIS domain, see Adding a Slave Server to the NIS Domain” (page 30) .
For more information see domainname (1), ypinit (1M), ypfiles (4), and Appendix A (page 49).
Verifying the NIS Slave Server Configuration
To verify the NIS slave server configuration, enter the following command to check whether the
NIS slave server is running:
/usr/bin/ypwhich
The ypwhich command must return the host name of the slave server. If the ypwhich command
does not return the name of the slave server, see “Troubleshooting NIS” (page 45) for more
information on troubleshooting.
For more information, see ypwhich (1).
Scheduling Regular Map Transfers from the NIS Master Server
The NIS maps are pushed from the NIS master server to the NIS slave server using map transfers.
You can schedule map transfers for files that are frequently modified, for example, /etc/passwd
and /etc/hosts sample scripts. The sample scripts are available in /usr/newconfig/var/yp.
You can customize these scripts to schedule the map transfer.
To schedule map transfers from the NIS master server, complete the following steps:
1. Log in to the slave server as superuser.
2. From the /usr/newconfig/var/yp directory, copy the sample scripts ypxfr_1perday,
ypxfr_2perday, and ypxfr_1perhour scripts to the /var/yp directory, as follows:
cp /usr/newconfig/var/yp/ypxfr_1perday /var/yp
cp /usr/newconfig/var/yp/ypxfr_2perday /var/yp
cp /usr/newconfig/var/yp/ypxfr_1perhour /var/yp
3. Create a crontab file to invoke these NIS scripts at regular intervals.
Following is an example of a crontab file:
0 21 * * * /var/yp/ypxfr_1perday
30 5,19 * * * /var/yp/ypxfr_2perday
15 * * * * /var/yp/ypxfr_1perhour
The crontab file runs the ypxfr_1perday script at 9:00 p.m. every night, and the
ypxfr_2perday script at 5:30 a.m. and 7:30 p.m. every day. It runs the ypxfr_1perhour
script at 15 minutes past every hour.
4. Enter the following command to add a file to crontab:
crontab filename
Where:
filename is the crontab file created in the previous step.
If you have created customized NIS maps for your domain, you must add the map names to the
appropriate scripts or you can use the scripts provided as templates to create your own scripts.
In some domains, frequently transferring huge maps may generate excessive network traffic. To
avoid this, you can schedule map transfers less frequently by editing the
/var/yp/ypxfer_1perhour script. You must create a new script that contains /etc/passwd
to be run at the desired lower frequency.
If you have multiple slave servers, ensure that the map transfer to all the servers does not happen
simultaneously. The time specified in the crontab file on each slave server must be different.
For more information, see cron (1M), crontab (1), and ypxfr (1M).
Verifying the NIS Slave Server Configuration 37