サービス名
autofs
説明
これにより、auto-mount が実行されます ファイルシステムマウント用のデーモン。 「自動マウント」デーモンは、「クライアントがこのデーモンにリクエストを送信するとファイルシステムをマウント」し、「長時間リクエストがない場合はマウントを解除します」。 Linux には autofs と AMD の 2 種類のオートマウンタがあります。 AMD はユーザー空間に実装されており、カーネルの一部ではありません。ただし、autofs はカーネルによって支援される新しいシステムであり、カーネル レバーのサポートが必要です。
前に述べたように、autofs はカーネル空間に実装されているため、autofs を使用するには、カーネルにサポートがコンパイルされている必要があります。2.2.xx 以降のカーネルのすべてのバージョンが autofs をサポートしています。次のコマンドを使用して、カーネルでコンパイルされているかどうかを確認できます。
# cat /proc/filesystems | grep autofs nodev autofs #
autofs は「マップ」を使用して、マウントするファイルシステムを定義します。異なる automounters マップは互いに互換性がありません。たとえば、amd マップは autofs と互換性がありません。 autofs が開始すると、構成ファイル /etc/auto.master を調べて、システム上のマウント ポイントを見つけます。これらのマウント ポイントごとに、適切なパラメータを使用して automount プロセスが開始されます。 auto.master 構成ファイルが処理された後、autofs は同じ名前の NIS マップをチェックします。
動的マウントはオーバーヘッドをもたらすため、より高いパフォーマンスが必要なシステムでは autofs を使用しないでください。
このサービスを含む RPM パッケージは次のとおりです:
autofs Nature
サービス コントロール
このサービスは、init.d スクリプト /etc/init.d/autofs によって処理されます。その使用法は次のとおりです:
# /sbin/service autofs Usage: /etc/init.d/autofs {start|stop|restart|reload|condrestart|status}
次のようにサービスを開始します:
# /sbin/service autofs start Starting automount: No Mountpoints Defined [ OK ]
次のようにサービスを停止します:
# /sbin/service autofs stop Stopping automount: [ OK ]
サービスが開始されているか停止されているかを確認します:
# /sbin/service autofs status Configured Mount Points: ------------------------ Active Mount Points: -------------------- #
再起動すると、実行中のデーモンが強制終了され、サービスが再度開始されます。
# service autofs restart Stopping automount: [ OK ] Starting automount: No Mountpoints Defined [ OK ]
サービスが開始されている場合は、再起動します。それ以外の場合は何もしません。
# service autofs condrestart
Reload コマンドは、実行中のデーモンに対して auto.master マップをチェックします。エントリが変更されたデーモンを強制終了し、新しいエントリまたは変更されたエントリのデーモンを開始します。
# service autofs reload
サービスのランレベル情報を照会して、再起動後にサービスの起動オプションを確認します:
# chkconfig --list autofs autofs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
構成
autofs automounter は、構成ファイル /etc/auto.master を使用してマウント ポイント マップを定義します。起動時に、このファイルをチェックし、このファイル内のすべてのエントリに対して automount デーモンを開始します。たとえば、既定のファイルはすべてのエントリをコメントアウトします。
# # Sample auto.master file # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # For details of the format look at autofs(5). #/misc /etc/auto.misc --timeout=60 #/misc /etc/auto.misc #/net /etc/auto.net
/etc/auto.master ファイルとともに、autofs は NIS マップもチェックします。そのようなマップが存在する場合、そのマップは auto.master マップと同じ方法で処理されます。NIS マップは最後に処理されます。
auto.master ファイルが示すように、すべてのマウント ポイント マップは、misc、net などのさまざまなカテゴリに分割されています。各ファイルには、詳細なマウント オプションを含むいくつかのマップが含まれています。たとえば、/etc/auto.misc の内容は次のとおりです。
# # $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $ # # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # Details may be found in the autofs(5) manpage cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom # the following entries are samples to pique your imagination #linux -ro,soft,intr ftp.example.org:/pub/linux #boot -fstype=ext2 :/dev/hda1 #floppy -fstype=auto :/dev/fd0 #floppy -fstype=ext2 :/dev/fd0 #e2floppy -fstype=ext2 :/dev/fd0 #jaz -fstype=ext2 :/dev/sdc1 #removable -fstype=ext2 :/dev/hdd
構成ファイル:
/etc/auto.master Master map file for automounter /etc/auto.misc Mount point map definitions