The databases that are supported by the name service switch are configured by using SMF services. To obtain a listing of these databases, use the svcfg command as shown in the following example.
# svccfg -s name-service/switch listprop config config application config/default astring files config/password astring "files nis" config/group astring "files nis" config/host astring "files nis" config/network astring "nis [NOTFOUND=return] files" config/protocol astring "nis [NOTFOUND=return] files" config/rpc astring "nis [NOTFOUND=return] files" config/ether astring "nis [NOTFOUND=return] files" config/netmask astring "files nis" config/bootparam astring "nis [NOTFOUND=return] files" config/publickey astring "nis [NOTFOUND=return] files" config/netgroup astring nis config/automount astring "files nis" config/alias astring "files nis" config/service astring "files nis" config/printer astring "user nis" config/auth_attr astring "files nis" config/prof_attr astring "files nis" config/project astring "files nis"
The following table explains the type of information that each database stores. From the SMF perspective, these databases are considered configurable properties of the service.
|
In addition, a default property in the name service switch defines the source string for any database that is not otherwise defined. The value for this property is set to files to indicate that all the databases and their information are found locally in the /etc directory. You can set up a different configuration for the default property based on the sources listed in Table 2–2. See How to Change the Source for All Naming Databases for the procedure.
The default property enables you to configure a source that universally applies to the databases, instead of configuring each database's source.
The following table describes the kind of sources that can be listed in the name service switch for the databases listed above.
|
The following search criteria formats can be used to select one or more information sources, and to specify the order that the sources are used.
Single Source — If an information type has only one source, such as files, a search routine that uses the switch searches for the information in that source only. If the routine finds the information, the routine returns a success status message. If the routine does not find the information, the routine stops searching and returns a different status message. What the routine does with the status message varies from routine to routine.
Multiple Sources — If a database contains multiple sources for a given information type, the switch directs the search routine to search in the first listed source. If the routine finds the information, the routine returns a success status message. If the routine does not find the information in the first source, the routine tries the next source. The routine searches all sources until the routine has found the information, or until the routine is halted by a return specification. If all of the listed sources are searched without finding the information, the routine stops searching and returns a non-success status message.
By default in the Oracle Solaris 11 release, the first source is files. This configuration prevents system hangs if the next source listed is not available.
If a routine finds the information, the routine returns a success status message. If the routine does not find the information, the routine returns one of three error status messages. Possible status messages are listed in the following table.
|
You can instruct the name service switch to respond to status messages with either of the two actions shown in the following table.
|
In addition, for the TRYAGAIN status message, the following actions can be defined
forever – Retries the current source indefinitely
n – Retry the current source n more times
The combination of the name service switch status message and action options determine what the search routine does at each step. The combination of the status message and action options make up the search criteria.
The switch's default search criteria are the same for every source. This list includes a description of several of the search criteria.
SUCCESS=return. Stop looking for the information. Proceed using the information that has been found.
UNAVAIL=continue. Go to the next name service switch source and continue searching. If this source is the last or only source, return with a NOTFOUND status.
NOTFOUND=continue. Go to the next name service switch source and continue searching. If this source is the last or only source, return with a NOTFOUND status.
TRYAGAIN=forever. Searches the current name service switch source indefinitely.
TRYAGAIN=3. Searches the current source three times. After exhausting three retries, the TRYAGAIN action transitions to continue and searches the next name service switch source.
You can change the default search criteria by explicitly specifying some other criteria by using the STATUS=action syntax shown in the preceding list. For the procedure, see How to Configure a Search Criterion for a Database.
The client library routines contain compiled-in default entries that are used if no specific SMF property or default SMF property is defined in the name service switch, or if the property is syntactically incorrect. Typically, these compiled-in defaults are “files” only.
The switch search criteria for the auto_home and auto_master tables and maps is combined into one category, which is called automount.
The timezone table does not use the name service switch, so the table is not included in the property list for the switch.