Information Technology Reference
In-Depth Information
6.
If the
ypbind(1M)
command is running, stop it by using the following
command:
/usr/lib/netsvc/yp/ypstop
7.
Restart the
ypbind
command using the following command:
/usr/lib/netsvc/yp/ypstart
8.
Run the
ypinit
command from the
/var/yp
directory as shown in the
following listing (where
master
is the hostname of the NIS master
server):
# cd /var/yp
# ypinit -s
master
To start the NIS slave server, reboot the system or repeat Steps 6 and 7.
Only the maps generated on the master server are copied to the slave server.
The original files used to generate the maps only reside on the master server.
NIS Client
A system can be configured as an NIS client using the following procedure:
1.
Use the
domainname
command to set the domain name.
2.
Update the
/etc/nsswitch.conf
file to use NIS either by copying the
/etc/nsswitch.nis
template file to it or by manually editing the
appropriate configuration.
3.
Log into the system as the root account and run the
ypinit
command
as shown here:
ypinit -c
4.
The
ypinit
command will prompt for one or more NIS servers. Enter
the hostnames of the closest NIS servers.
Updating and Adding NIS Maps
Updating one of the default maps (one is automatically generated when the
master server is configured) is fairly straightforward. Edit the appropriate
source file on the NIS master server, and then execute the
make(1)
command
from the
/var/yp
directory. The name of the map being updated must be
specified as a command-line argument to the
make
command. The
make
command uses the file named
Makefile
located under the
/var/yp
directory
to update the map and automatically propagate the updated map to any slave