Solaris 2.6 リリースでは、nsswitch.conf のテンプレートファイルが 3 種類提供されます。デフォルトの情報ソース (一次ソース、およびそれに続くもの) としては、それぞれ異なったものが指定されています。
3 種類のテンプレートファイルの詳細は以下のとおりです。
「NIS+ テンプレートファイル」(nsswitch.nisplus ファイル)
このテンプレートファイルで passwd、group、automount、aliases を除くすべての情報の一次ソースとして指定されているのは、NIS+ です。passwd、group、automount、aliases の一次ソースとして指定されているのは /etc ディレクトリのファイルで、二次ソースとして指定されているのは NIS+ テーブルです。[NOTFOUND=return] という検索基準は、「No such entry」というメッセージを受け取ったら NIS+ テーブルの検索を停止する」という意味です。また、ローカルファイルを検索するのは NIS+ サーバーを使用できない場合だけです。
「NIS テンプレートファイル」(nsswitch.nis ファイル)
NIS+ テーブルではなく NIS マップを使用するという点を除けば NIS+ テンプレートファイルとほぼ同じです。passwd、group の情報に関しては files nis という順序で検索するよう指定されているため、/etc/passwd と /etc/group に + エントリを指定する必要はありません。
「Files テンプレートファイル」(nsswitch.files ファイル)
このテンプレートファイルでは、ローカルの /etc ディレクトリのファイルだけがワークステーションの情報ソースとして指定されています。netgroup に関する files のソースは存在しないため、クライアントがスイッチファイルでこのエントリを使用することはありません。
要求するものに最も近いテンプレートファイルを nsswitch.conf にコピーし、必要に応じて修正します。この手順の詳細は、『Solaris ネーミングの設定と構成』のスイッチに関する章を参照してください。
たとえば、NIS+ テンプレートファイルを使用するには、以下のコマンドを入力します。
mymachine# cp nsswitch.nisplus nsswitch.conf
3 つのスイッチファイルは、Solaris 2.6 リリースでは、以下のようになります。
# # /etc/nsswitch.nisplus: # # An example file that could be copied over to /etc/nsswitch.conf; # it uses NIS+ (NIS Version 3) in conjunction with files. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" # transports. # the following two lines obviate the "+" entry in /etc/passwd # and /etc/group. passwd: files nisplus group: files nisplus # consult /etc "files" only if nisplus is down. hosts: nisplus [NOTFOUND=return] files # Uncomment the following line, and comment out the above, to use # both DNS and NIS+. You must also set up the /etc/resolv.conf # file for DNS name server lookup. See resolv.conf(4). # hosts: nisplus dns [NOTFOUND=return] files services: nisplus [NOTFOUND=return] files networks: nisplus [NOTFOUND=return] files protocols: nisplus [NOTFOUND=return] files rpc: nisplus [NOTFOUND=return] files ethers: nisplus [NOTFOUND=return] files netmasks: nisplus [NOTFOUND=return] files bootparams: nisplus [NOTFOUND=return] files publickey: nisplus netgroup: nisplus automount: files nisplus aliases: files nisplus sendmailvars: files nisplus
# # /etc/nsswitch.nis: # # An example file that could be copied over to /etc/nsswitch.conf; # it uses NIS (YP) in conjunction with files. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" # transports. # # the following two lines obviate the "+" entry in /etc/passwd # and /etc/group. passwd: files nis group: files nis # consult /etc "files" only if nis is down. hosts: nis [NOTFOUND=return] files networks: nis [NOTFOUND=return] files protocols: nis [NOTFOUND=return] files rpc: nis [NOTFOUND=return] files ethers: nis [NOTFOUND=return] files netmasks: nis [NOTFOUND=return] files bootparams: nis [NOTFOUND=return] files publickey: nis [NOTFOUND=return] files netgroup: nis automount: files nis aliases: files nis # for efficient getservbyname() avoid nis services: files nis sendmailvars: files
# # /etc/nsswitch.files: # # An example file that could be copied over to /etc/nsswitch.conf; # it does not use any naming service. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" # transports. passwd: files group: files hosts: files networks: files protocols: files rpc: files ethers: files netmasks: files bootparams: files publickey: files # At present there isn't a 'files' backend for netgroup; # the system will figure it out pretty quickly, and won't use # netgroups at all. netgroup: files automount: files aliases: files services: files sendmailvars: files
Solaris オペレーティングシステムを初めてインストールするときのデフォルトの nsswitch.conf ファイルは、Solaris のソフトウェアをインストールする際に選択したネームサービスで決まります。ネームサービスが選択されると、そのサービスのスイッチテンプレートファイルがコピーされ、新しい nsswitch.conf ファイルが作成されます。たとえば、NIS+ が選択された場合は、nsswitch.nisplus ファイルがコピーされて nsswitch.conf ファイルが作成されます。