9.4.3. サイト設定ファイルの上書きまたは拡張
クライアントシステム上の特定マウントポイントのサイトデフォルト値を無効にする場合に便利です。たとえば、次の条件を検討します。
- 自動マウント機能マップは NIS に保存され、
/etc/nsswitch.confファイルには以下のディレクティブがあります。automount: files nis
automount: files nisCopy to Clipboard Copied! Toggle word wrap Toggle overflow auto.masterファイルには、+auto.master
+auto.masterCopy to Clipboard Copied! Toggle word wrap Toggle overflow - NIS の
auto.masterマップファイルには、以下が含まれます。/home auto.home
/home auto.homeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - NIS の
auto.homeマップには以下が含まれています。beth fileserver.example.com:/export/home/beth joe fileserver.example.com:/export/home/joe * fileserver.example.com:/export/home/&
beth fileserver.example.com:/export/home/beth joe fileserver.example.com:/export/home/joe * fileserver.example.com:/export/home/&Copy to Clipboard Copied! Toggle word wrap Toggle overflow - ファイルマップ
/etc/auto.homeは存在しません。
このような状況でクライアントシステムが NIS マップの
auto.home を無効にして、ホームのディレクトリーを別のサーバーからマウントする必要があると仮定します。この場合、クライアントは以下の /etc/auto.master マップを使用する必要があります。
/home /etc/auto.home +auto.master
/home /etc/auto.home
+auto.master
/etc/auto.home マップにはエントリーが含まれます。
* labserver.example.com:/export/home/&
* labserver.example.com:/export/home/&
自動マウント機能で処理されるのは 1 番目に出現するマウントポイントのみになるため、
/home には NIS auto.home マップではなく、/etc/auto.home のコンテンツが含まれます。
一方、サイト全体の
auto.home マップにいくつかのエントリーを加えて拡大させたい場合は、/etc/auto.home ファイルマップを作成して新しいエントリーを組み込みます。最後に、NIS の auto.home マップを含めます。次に、/etc/auto.home ファイルマップは以下のようになります。
mydir someserver:/export/mydir +auto.home
mydir someserver:/export/mydir
+auto.home
上記の NIS の
auto.home マップがリストされると、ls /home が出力されます。
beth joe mydir
beth joe mydir
autofs は、読み取り中のファイルマップと同じ名前のファイルマップの内容を組み込まないため、上記の例は期待どおりに動作します。このように、autofs は、nsswitch 設定内の次のマップソースに移動します。