21.3.3. autofs の一般的なタスク
21.3.3.1. サイト設定ファイルの上書きまたは拡張 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
クライアントシステム上の特定マウントポイントのサイトデフォルト値を無効にする場合に便利です。たとえば、自動マウント機能マップが NIS に保存され、
/etc/nsswitch.conf ファイルに以下のディレクティブがあるとします。
automount: files nis
automount: files nis
NIS の
auto.master マップファイルには以下が含まれています。
/home auto.home
/home auto.home
また、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/&
また、ファイルマップ
/etc/auto.home は存在しません。
上記の例では、クライアントシステムが別のサーバーからホームディレクトリーをマウントする必要があると仮定します。この場合、クライアントは以下の
/etc/auto.master マップを使用する必要があります。
/home /etc/auto.home2 +auto.master
/home /etc/auto.home2
+auto.master
また、
/etc/auto.home2 マップにはエントリーが含まれます。
* labserver.example.com:/export/home/&
* labserver.example.com:/export/home/&
マウントポイントの最初の出現のみが処理されるため、
/home には NIS auto.home マップではなく /etc/auto.home2 の内容が含まれます。
または、サイト全体の
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 マップを指定すると、/home の ls により以下が提供されます。
ls /home
~]$ ls /home
beth joe mydir
autofs は、読み取り中のファイルマップと同じ名前のファイルマップの内容を含まないことを認識しているため、この最後の例は期待どおりに動作します。したがって、nsswitch 設定の次のマップソースに移動します。