Maps That Refer to Other Maps

Special characters that precede map names in map entries in a file map affect how the map name is processed.

  • A map entry +mapname that is used in a file map causes automount to read the specified map as if it were included in the current file.

  • If mapname is not preceded by a slash, autofs treats the map name as a string of characters and uses the name-service switch policy to find the map name. If the path name is an absolute path name, automount checks a local map of that name.

  • If the map name starts with a dash (-), automount consults the appropriate built-in map, such as hosts.

The svc:system/name-service/switch service contains the search order for the naming services. The automount property in the config property group specifies the order that the name service databases are searched when looking for automount entries. If no specific config/automount property is specified, then the order defined in the config/default property is used.

Example 2-2 Displaying the Search Order of Maps by the automount command

# svcprop -p config svc:/system/name-service/switch
config/value_authorization astring solaris.smf.value.name-service.switch
config/printer astring user\ files
config/default astring files\ nis
config/automount astring files\ nis

The example shows that the maps in the local files are searched before the NIS maps. The same would be true if the config/automount property was not specified because the config/default entry would be used. Therefore, you can have a few entries in your local /etc/auto_home map for the most commonly accessed home directories. You can then use the switch to fall back to the NIS map for other entries.

bill               cs.csc.edu:/export/home/bill
bonny              cs.csc.edu:/export/home/bonny

After consulting the included map, if no match is found, automount continues scanning the current map. Therefore, you can add more entries after a + entry.

bill               cs.csc.edu:/export/home/bill
bonny              cs.csc.edu:/export/home/bonny
+auto_home 

The map that is included can be a local file or a built-in map. Only local files can contain + entries.

+/etc/auto_mystuff      # local map
+auto_home              # NIS map
+-hosts                 # built-in hosts map 

Note:

You cannot use + entries in NIS maps.