The new map name must be added to the list of targets built by default when make is issued with no arguments. A dependency linking the map name auto.tools to the timestamp file auto.tools.time is added, and the large section defines how to rebuild the map and the timestamp file from the map source file. The makefile actions strip out all lines beginning with a comment (#) marker, and strip comments from the ends of lines. The makedbm program builds an NIS map from the input file. The input file should not have blank lines in it. The key in an automounter map becomes the NIS map key, and the mount options and server and directory names are the data values. Dumping a map with ypcat requires the -k option to match up map keys and server information:In definition of target all: all: passwd hosts ..... auto.tools auto.tools: auto.tools.time auto.tools.time: $(DIR)/auto_tools -@if [ -f $(DIR)/auto_tools ]; then \ sed -e "/^#/d" -e s/#.*$$// $(DIR)/auto_tools | \ $(MAKEDBM) - /var/yp/$(DOM)/auto.tools;\ touch auto.tools.time; \ echo "updated auto.tools"; \ if [ ! $(NOPUSH) ]; then \ $(YPPUSH) auto.tools; \ echo "pushed auto.tools"; \ fi \ else \ echo "couldn't find $(DIR)/auto_tools"; \ fi
NIS-managed maps are specified by map name rather than by absolute pathname:% ypcat auto.tools -ro,intr thud:/epubs/deskset jetstar:/usr/Bugview -ro,intr mahimahi:/tools2/deskset1.0 % ypcat -k auto.tools sundesk -ro,intr thud:/epubs/deskset bugview jetstar:/usr/Bugview deskset -ro,intr mahimahi:/tools2/deskset1.0
Master map /tools auto_tools -ro /source auto_source -rw
This is useful if you want more control over the order with which map information from the /etc/auto_master file versus the name service gets processed. The appearance of this entry causes map information from the NIS auto.master map to read in as if it were where the +auto_master entry was. For example, let's say nsswtch.conf has an automount: entry that specifies files to be processed before nis. The auto.master map in NIS might contain:+auto_master
The /etc/auto_master file might contain:/docs auto_temporary -ro
The effect is that the accesses to /docs/XXX are satisfied from the auto_temporary map and not from the auto_docs map. The use of entries with leading plus signs is not limited to auto_master entries. Any of the maps that auto_master refers to can contain +mapname entries if they are local files. Suppose, for example, that client machines on your network share a common set of source trees, but some clients are allowed to access operating system source code as well. On those machines without source code rights, the /etc/auto_source map contains a single reference to the NIS map:/tools auto_tools -ro +auto_master /docs auto_docs /src auto_source /- auto_direct
However, on clients that have more privileges, the operating system source code mount points can be included with the NIS map:+auto_source
sunos5.7 -ro srcserv:/source/sunos5.7 sunos5.8 -ro srcserv:/source/sunos5.8 nfs -ro bigguy:/source/nfs_internals +auto_source
9.2. Invocation and the master map | 9.4. Key and variable substitutions |
Copyright © 2002 O'Reilly & Associates. All rights reserved.