Go to main content

Working With Oracle® Solaris 11.3 Directory and Naming Services: DNS and NIS

Exit Print View

Updated: October 2017

Modifying Makefile Entries

The following procedure describes how to add and delete databases from the Makefile.

How to Modify /var/yp/Makefile to Use Specific Databases

This procedure requires that you have already configured an NIS master server.

  1. Become an administrator.

    For more information about obtaining the appropriate rights to perform specific tasks, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

  2. Modify the line that starts with the word all by adding the names of the database you want to add:
    all: passwd group hosts ethers networks rpc services protocols \
    netgroup bootparams aliases netid netmasks \
    audit_user auth_attr exec_attr prof_attr \

    The order of the entries is not relevant, but the blank space at the beginning of the continuation lines must be a Tab, not spaces.

  3. Add the following lines at the end of the Makefile:
    auto_direct: auto_direct.time
    auto_home: auto_home.time
  4. Add an entry for auto_direct.time in the middle of the file.
    auto_direct.time: $(DIR)/auto_direct
    @(while read L; do echo $$L; done < $(DIR)/auto_direct
    $(CHKPIPE)) | \ (sed -e "/^#/d" -e "s/#.*$$//" -e "/^ *$$/d"
    $(CHKPIPE)) | \ $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto_direct;
    @touch auto_direct.time;
    @echo "updated auto_direct";
    @if [ ! $(NOPUSH) ]; then $(YPPUSH) auto_direct; fi
    @if [ ! $(NOPUSH) ]; then echo "pushed auto_direct"; fi
    • CHKPIPE makes certain that the operations to the left of the pipe (|) are successfully completed before piping the results to next commands. If the operations to the left of the pipe do not successfully complete, the process is terminated with a NIS make terminated message.

    • NOPUSH prevents the makefile from calling yppush to transfer the new map to the slave servers. If NOPUSH is not set, the push is done automatically.

    The while loop at the beginning is designed to eliminate any backslash-extended lines in the input file. The sed script eliminates comment and empty lines.

    Follow the same procedure for all other automounter maps, such as auto_home or any other non-default maps.

  5. Run the make command.
    # make mapname

    where mapname is the name of the map you want to make.

How to Modify the Makefile to Delete Databases

If you do not want the Makefile to produce maps for a specific database, edit the Makefile as follows.

  1. Delete the name of the database from the all rule.
  2. Delete or comment out the database rule for the database you want to delete.

    For example, to delete the hosts database, the hosts.time entry should be removed.

  3. Remove the time rule.

    For example, to delete the hosts database, the hosts: hosts.time entry should be removed.

  4. Remove the map from the master and slave servers.