The ypinit script sets up the master server and the slave servers and clients to use NIS. It also initially runs the make command to create the maps on the master server.
To use the ypinit command to build a fresh set of NIS maps on the master server, complete the following procedure.
For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.
Add the host name and IP address of each NIS server. Use the following format: IPaddress FQDN-hostname aliases.
For example:
192.0.2.1 master.example.com master 192.0.2.2 slave1.example.com slave1 192.0.2.3 slave2.example.com slave2
# /usr/sbin/ypinit –m
When ypinit prompts for a list of other systems to become NIS slave servers, type the name of the server you are working on, along with the names of the NIS slave servers that you specified in the /etc/inet/hosts file.
# domainname example.com
When ypinit asks whether you want the procedure to terminate at the first nonfatal error or continue despite nonfatal errors, type y. When you choose y, ypinit exits upon encountering the first problem. You can then fix it and restart ypinit. This is recommended if you are running ypinit for the first time. If you prefer to continue, you can try to manually fix all problems that occur, and then restart ypinit.
The ypinit command asks whether the existing files in the /var/yp/domain-name directory can be destroyed. This message is displayed only if NIS is already installed. Typically, you would choose to delete the source files to clean up the files from a previous installation.
This program uses the instructions contained in the Makefile (either the default file or the one you modified) located in /var/yp. The make command cleans any remaining comment lines from the files that you designated. It also runs makedbm on the files, creating the appropriate maps and establishing the name of the master server for each map.
If the map or maps being pushed by the Makefile correspond to a domain other than the one returned by the domainname command on the master, you can make sure that they are pushed to the correct domain by starting make in the ypinit shell script with a proper identification of the variable DOM, as follows:
# make DOM=domain-name passwd
This command pushes the passwd map to the intended domain, instead of the domain to which the master belongs.