\documentclass[letterpaper]{article}
\nonstopmode
\bkai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{Automount mini-Howto ÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡}
\author{{\ttfamily don@sabotage.org}}
\date{v0.3, 22 October 1998}
\abstract{³o¥÷¤å¥ó¦b´y­z¦Û°ÊÀÉ®×¨t²Îªº¦Û°Ê±¾¸üµ{¦¡¡A¦p¦ó³]©w¨Ã«ü¥X¤@¨ÇÀ³¸ÓÁ×§Kªº°ÝÃD¡C}


\begin{document}
\maketitle
\tableofcontents

\section{Â²¤¶}


\subsection{ÀÉ®×¨t²Î¦Û°Ê±¾¸ü - ¬O¤°»ò¤Î¬°¤°»ò}

ÀÉ®×¨t²Î¦Û°Ê±¾¸ü¬O¤@­Ó¥i°w¹ï¯S©wÀÉ®×¨t²Î¦Û°Ê±¾¸ü(¨ø¸ü)ÀÉ®×¨t²Îªº daemon¡C
°²¦pÀÉ®×¨t²Î¤w¸g¨ø¤U¤F¡A¦Ó¤@­Ó¨Ï¥ÎªÌ¹Á¸Õ¥h¨Ï¥Î¥¦¡A
¨º»òÀÉ®×¨t²Î·|¦Û°Êªº¦A±¾¸ü¤W¥h¡C³o¦b¤j«¬ªººô¸ôÀô¹Ò¸Ì¡A
¥H¤Î¤@¨Ç¦b¾÷¾¹¤§¶¡¬Û¤¬±¾¸üÀÉ®×¨t²Îªº®É­Ô¯S§O¦³¥Î (¤×¨ä¬O¨º¨Ç¤£¬O¤@ª½¶}¾÷ªº¾÷¾¹)¡C
¹ï¤@¨Ç¥i²¾¦¡ªº¸Ë¸m©Î¤@¨Ç¨ä¥L¥Î³~³£«Ü¦³¥Î¡A¹³¬O¥i¥H«Ü®e©öªº¦b DOS ÀÉ®×¨t²Î¤W°µ¤@¨Ç±j¨îªº ascii ªºÂà´«¡C




\subsection{ÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡ªººØÃþ}

¦b Linux ¤W¦³¨âºØÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡; {\itshape AMD\/} ©M {\itshape autofs\/}¡C
AMD ¬OÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡ªº daemon ¡A¦Ó¥B¥\¯à´N¹³ SunOS ¤Wªº AMD ¤@¼Ë¡C¥¦¬O¦b User space ¤¤¹ê§@ªº¡A´N¬O»¡¥¦¤£¬O®Ö¤ßªº¤@³¡¥÷¡C
¥¦¤]¤£»Ý­n®Ö¤ßª¾¹DÀÉ®×¨t²Î¦Û°Ê±¾¸ü¬O«ç»ò¤@¦^¨Æ¡A°²¦p§A¥Î NFS ±¾¤W¥»¾÷ªºÀÉ®×¨t²Î¡A³z¹L AMD ¡A
¥¦À°§A³B²z¤F©Ò¦³³z¹L NFS ¨t²ÎªºÀÉ®×¨t²Î¦Û°Ê±¾¸ü®Éªººô¸ô°T®§¥æ´«¡C
Autofs ¬O¤@­Ó¥Î¥H»²§U®Ö¤ßªº·s¨t²Î¡A¤]´N¬O»¡®Ö¤ßªºÀÉ®×¨t²Îµ{¦¡½Xª¾¹D¦Û°Ê±¾¸üÂI¦b­þ¡A
¥H¤Î¥¦©³¼h©Ò¨Ï¥ÎªºÀÉ®×¨t²Î¬O¤°»ò¡AµM«á¦Û°Ê±¾¸üµ{¦¡«K¥i¥H¶}©l¹B§@¡C
¦b³o¥÷¤å¥ó¤¤¥u·|½Í¨ì autofs¡C




\section{¦w¸Ë}

¦]¬° autofs ¬O¹ê§@¦b®Ö¤ßªÅ¶¡¡A§Aªº®Ö¤ß¤@©w­n¥[¤J autofs ¤ä´©¡C¦b 2.0.xx ª©¡A¥¦ÁÙ¬O¤@­Ó¹êÅç©Ê¿ï¶µ¡A¦ý¬O¤w¸g¬Û·íÃ­©w¡C
¦bª©¥» 2.1.xx (©M 2.2.xx) ´N¤£¦A¬O¹êÅç©Êªº¤F¡C



ÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡©M¥¦ªº³]©wÀÉ³£¬O¥²³Æªº¡A¥Î rpms (¦b RedHat ¸Ì¡A¬O¦w¸Ëªº¤@³¡¥÷) ¬O«Ü¦nªº¤èªk¡C
ÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡À³¸Ó¥Ñ {\ttfamily /etc/rc.d/init.d} ¥Ø¿ý¤Uªº¢à¢ÑÀÉ±Ò°Ê¡C
rpm ·|´À§A¦w¸Ë³o¨Çµ{¦¡¤Î³]©wÀÉ¡A¦ý¬O§AÀ³¸Ó¥h½T©w¥¦³Q±Ò°Ê¤F¨S¡A¤£ºÞ¬O¥Î 
RedHat ªº control-panel ©Î¬O¨ä¥L Linux ®M¥óªº¥ô¦ó¤è¦¡¡C
«D rpm ªº®M¥ó¤]·|¦³¾A¦X¥L­Ì¦Û¤v¨t²Îªº¨º¤@®M¡C
°²¦p§A¥¿¦bÅª³o¥÷¤å¥ó¡Aªí¥Ü§A¥i¯à¤£·Qª¾¹D rc °µ¨Ç¤°»ò¡A©Ò¥H¤£¥²ªá¤Ó¦h¥\¤Ò¦b
¬ã¨s rc ´y­zÀÉ¦b°µ¨Ç¤°»ò¨Æ¡C




\section{³]©w}

§Q¥Î RPM ¦w¸Ë autofs ±N·|«Ü»´ÃP¦a§â§A±a¨ì³o­Ó¨BÆJ¡A
¦ý¬O²{¦bªº³o­Ó³¡¤À§A¥i¯àµLªk½T©w§A¬O§_´¿¸g°µ¹L¡C



¦b /etc ¤U­±¦³¨â­ÓÀÉ®×¡A¤@­Ó¬O {\ttfamily auto.master} ¦Ó¥t¥~¤@­Ó¬O {\ttfamily auto.misc} ¡C
§Úªº auto.master ¬Ý°_¨Ó¹³³o¼Ë:
\begin{verbatim}
/auto   /etc/auto.misc  --timeout 60
\end{verbatim}


²Ä¤@­ÓÄæ¦ì¤£¬O±¾¸üÂI¡A¥¦¬O±¾¸üÂIªº¶°¦X¡]¦b²Ä¤G­ÓÄæ¦ì¥i¥H§ä¨ì¡^©Ò¦bªº¦a¤è¡C
²Ä¤T­Ó¿ï¶µ¬O»¡¦Û°Ê±¾¸üªºÀÉ®×¨t²Î¦b¨Ï¥Î«áªº 60 ¬í«á·|¸ÕµÛ¨ø¸ü¤U¨Ó¡C
·íµM¡A¦pªG¥¿¦b¨Ï¥Î¤¤¬O¤£¯à¨ø¤Uªº¡C

Auto.misc ¬O¤@­Ó ¡§¬M®gÀÉ¡§¡C ¦h­Ó¬M®gÀÉ¥i¥H¦b auto.master ¤¤³Q©w¸q¡C
§Úªº auto.misc ¬Ý°_¨Ó¹³¬O³o¼Ë:
\begin{verbatim}
kernel          -ro,soft,intr           ftp.kernel.org:/pub/linux
cd              -fstype=iso9660,ro      :/dev/cdrom
zip             -fstype=auto            :/dev/hdd4
floppy          -fstype=vfat            :/dev/fd0
\end{verbatim}


²Ä¤@­ÓÄæ¦ì¬O±¾¸üÂI¡C¦b³o­Ó¨Ò¤l¥¦¥i¯à¬O /auto/floppy ¤°»òªº¡C¤¤¶¡Äæ¦ì¬O¿ï¶µ¡F
§A¥i¥H¦b mount ªº½u¤W¨Ï¥Î»¡©ú¤¤§ä¨ì¬ÛÃöªº¸ê°T¡C³Ì«á¤@­ÓÄæ¦ì«ü¥XÀÉ®×¨t²Îªº¨Ó·½¡C
¼gµÛ "kernel" ªº¨º¤@¦æªí¥Ü¥Î NFS ¨Ó±¾¸üÀÉ®×¨t²Î¡C¨ä¥L¦æªº«_¸¹ªí¥Ü³o¬O¥»¾÷ªº¸Ë¸m¡C




\section{µ¥«Ý¨ø¤UÀÉ®×¨t²Î¥i¯u¬Oº©ªø}

¦³¨Ç¤H¥i¯à²´¸C¸Cµ¥µÛ 60 ¬íªº timeout ®É¶¡¨ì¨Ã¥B·QµÛ{\itshape  
¦pªG­n°h¥XºÏ¤ù³o¥i¯u¬O¤Ó¤[¤F.. 
¤]³\§Ú¥i¥Hª½±µ¹ïºÏºÐ¤U sync µM«á®³¥XºÏ¤ù¦Ó¥B¨S¦³¤H·|ª`·N¨ì¡C\/}
Åý§Ú¨Ó«ØÄ³¤@­Ó {\ttfamily ¤ñ¸û²z´¼ªº´À¥N¤è®×}¡C
­º¥ý©O¡A§A¥i¥H§ïÅÜ timeout ªº­È¡A¦ý¬O¦b¨Ï¥Î«áªº15¬í©Î¨ä¥L¬í¼Æ´NÅý¨t²Î¨ø¤UÀÉ®×¨t²Î
¦ü¥G¦³ÂI¨S®Ä²v¡C
¹ê»Ú¤W¦³¤@­Ó¤èªk¥i¥HÅýÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡¨ø¤UÀÉ®×¨t²Î¡C¦pªG§A°e¤@­Ó(¥Î kill µ{¦¡) °T¸¹ {\ttfamily SIGUSR1} µ¹ÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{§Ç¡A
¥¦·|¨ø¤U¥ô¦ó¥¦¥i¥H¨ø¤Uªº¡C¦ý¬O¤H­Ì¶}©l¦b¥L­Ìªºµøµ¡ºÞ²zµ{¦¡¤W°µ¤@­Ó¨ø¤UÀÉ®×¨t²Îªº«ö¶s¤§«e¡AÁÙ¦³¤@­Ó¤p°ÝÃD¡C

ÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{§Ç¬O³Q root ©Ò°õ¦æªº¡A©Ò¥H¥¦¥u¯à±µ¨ü root ªº°T¸¹¡C
§A·Q¥ÎÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡¥i¯à¦³¥b¼Æ¥H¤Wªº²z¥Ñ¬O¦]¬°§A¤£¬O¨t²ÎºÞ²z­û«o·Q­n
±¾¤J©M¨ø¤UÀÉ®×¨t²Î¡C
¼g¤@­Ó¥i¥H³]©w¨Ï¥ÎªÌ¨­¥÷ÃÑ§O½Xªº¢Ñµ{¦¡¥i¥H»´©ö¹F¦¨¡A¦ý³o¼Ëªº¤èªk¨Ã¤£¦n¡C
¤£ºÞ«ç¼Ë¡AÂÇ¥Ñ sudo µ{¦¡¤]¥i¥H¤¹³\¨Ï¥ÎªÌ°e¥X¤@¨Ç¾A·íªº kill °T¸¹¡C
°ß¤@ªº°ÝÃD¬O sudo ¨Ã¤£¤¹³\§A¥H ` ¨Ó°õ¦æ¦¸©R¥O¡A©Ò¥H§A¥²¶·¦Û¤v§ä¥X autofs ªº
µ{§ÇÃÑ§O½X¡C
§AÀ³¸Ó¦³¤@­Óµ{¦¡¥s°µ killall¡A³o¥i¥HÅý§A°µ¨ì³o¨Ç: (©¯¦n¦³³o¨Ç­Ó«ØÄ³)

\begin{verbatim}
ALL     ALL=NOPASSWD:/usr/bin/killall -USR1 automount
\end{verbatim}

§_«h¡A§A­n¤¹³\§Aªº¨Ï¥ÎªÌ°e -SIGUSR1 µ¹©Ò¦³ªºµ{§Ç¡C
³o¹ï¤@¨Çµ{¦¡¦³¤£¦Pªº¼vÅT¡F¥¦¥i¯à·|¨Ï¬Y¨Çµøµ¡ºÞ²z¾¹­«·s±Ò°Ê¡A¦Ó¥B²×¤î xemacs¡C
©Ò¥H¦b³o¨à§Æ±æ killall ¨S¦³½w½Ä°Ï·¸¥Xªº°ÝÃD...




\section{°ÝÃD}






\subsection{§Ú§ä¤£¨ì /auto/floppy ¡A©Î¥ô¦ó§Ú­n§äªº±¾¸üÂI¡C}

¦pªG automount ¥¿½Tªº¦w¸Ë¡A§Y¨Ï¨S¥Î¨ì®É¬Ý¤£¨ì³o¨Ç±¾¸üÂI¡A·í§A¸ÕµÛ¥Î¥¦®É¡A¥ô¦ó§A­n
ªº±¾¸üÂI³£·|¦b¨º¨à¡C
¦pªG§A¥Î¹Ï§Î¬É­±ªº¥Ø¿ýÂsÄýµ{¦¡¡A§A¥i¯à­n¤â°Ê¥´¤J±¾¸üÂIªº¦W¦r¡C
¤£©¯ªº¬O¡AµLªk±q¬Ý¤£¨£ªº³o¨Ç±¾¸üÂI¤¤¿ï¥X©Ò­n¥Îªº¡A¥¿¬O autofs ªº¥D­n¯ÊÂI¡C
¦pªG³o³y¦¨§Aªº°ÝÃD¡A¥h½s¿è³]©wÀÉ®×¡C
(´£¥Ü¡A´N¬O¨º¨Çµ²§À¬O .c ªºÀÉ)




\subsection{§Ú«ç»ò¬Ý¨ì¤w¸g±¾¸ü­þ¨ÇªF¦è¡H}

¥Î {\ttfamily df} ©R¥O¡C {\ttfamily mount} ¤£¥[¥ô¦óªº¿ï¶µ¤]¦³¦P¼Ëªº¥\¯à¡A¨Ã¥B¨q¥X¥¦©Ò±¾¤Wªº¤@¨Ç¿ï¶µ¡C




\subsection{§Ú©ñ¶i¤@¤ù win95 ªººÏ¤ù ("vfat") ¦Ó¥¦«o¦Û°Ê°»´ú¨ì¥¦¥u¬O¤@¤ù¤@¯ëªº FAT ºÏ¤ù¡C}

³o¤£¬OÀÉ®×¨t²Î¦Û°Ê±¾¸üµ{¦¡ªº°ÝÃD¡C·í³o¥÷¤å¥ó¥¿¦b¼gªº®É­Ô¡A
"auto" ³oºØÀÉ®×ºØÃþ¦b¦¨¥\ªº±¾¸ü¤@­Ó msdos ÀÉ®×¨t²Î¤§«e¨Ã¤£·|¹Á¸Õ vfat ªº±¾¸ü¡C
VFAT ´N¬O§â Win95 ©M WinNT ªºªøÀÉ¦WÀ½¶i FAT/MSDOS ÀÉ®×¨t²Î¡C



®Ú¾Ú mount ªº¨ä¤¤¤@­Ó§@ªÌ»¡¡A¦]¬° mount ¥u¬O¥]¸Ë¤F¤@­Ó¥²¶·«ü©wÀÉ®×¨t²ÎºØÃþªº¨t²Î©I¥s¡A
§âÀÉ®×¨t²ÎºØÃþ§Ë²M·¡¤´µM¬O¨Ï¥ÎªÌªº³d¥ô¡C
Åý mount ·ÓµÛ¦Cªíªº¶¶§Ç¡A¥h¤@ºØ¤@ºØªºÀÉ®×¨t²Î¥h¸Õ¡A¦Ó¤£¬O¥Î¥Ø«e¤´¦b¦Ò¼{ªº±Òµo¦¡ªº¤èªk¡C
§Ú½T©w¦pªG¦³¥ô¦ó¤H·Q­n§V¤O§ä¥X mount µ{¦¡ªº§@ªÌ¡]­Ì¡^¡A¥L­Ì±N·|Åwªï§Aªº«ØÄ³¡C
©Ò¥H²{¦b©O¡A³oªí¥Ü§A¤£¯à±¾¸ü vfat °£«D§A©ñ±ó¦Û°Ê°»´ú¨ä¥LÀÉ®×¨t²Îªº¯à¤O¡C
§Æ±æ³o«Ü§Ö´N¯à§ï¶i¡C¦b¦¹¦P®É¡A§A¤w¸g¥i¥H«Ü¦Û¥Ñªº«Ø¥ß¦h­Ó±¾¸üÂI¨Ã«ü©w¤£¦PªºÀÉ®×¨t²Î¡C






\subsection{§ÚªºÀÉ®×¨t²Î {\ttfamily /grumblesmurf} ¤w¸g±¾¤W¦ý¬O¥Î {\ttfamily kill -SIGUSR1} «oµLªk¨ø¸ü¡C}

³oªí¥Ü¥¦¥¿¦b¨Ï¥Î¤¤¡C¥i¯à³s¨t²ÎºÞ²z­û³£¤£¯à¥Î¤â°Êªº¨ø¸ü¥¦¡C
¦pªG§A¬OÅý¥¦¦Û°Ê±¾¸üªºªº¤H(¤]´N¬O»¡¡A¤£¥i¯à¬O§O¤H¥¿¦b¥Î¥¦)¬Ý¬Ý¬O¤£¬O¦³¤@­Ó shell
¬O¦b¨º­Ó¥Ø¿ý¤¤¡C
°²¦p¨S¦³ªº¸Ü¡A§ä§ä¬Ý¨ä¥LªF¦è(¯S§O¹³¬O¥Ø¿ýÂsÄý¾¹¤§Ãþªº)¥i¯à¯d¤U¤°»ò¬Ý¤£¨£ªºªF¦è¦b¸Ì­±¡C
°²¦p§A©ñ±ó´M§ä¡A§A¥i¥H¸Õ¸Õ fuser µ{¦¡¡C




\subsection{¦³ autofs ³o¼Ëªº¦nªF¦è¡A§ÚÀ³¸Ó·PÁÂ½Ö©O¡H}

¨M¤£·|¬O§Ú¡C³o¸ò§Ú¤@ÂIÃö«Y¤]¨S¦³¡C§Ú¥u¬O­nÅý¤j®aª`·N¨ì autofs ¦³¦h´Î¡A¦³¦h»òªº®e©ö¨Ï¥Î.
¤ñ°_ AMD ªº­ì³Ðªº¨º¨Ç¤H(´£¥Ü¡A¥L­Ì½æ¤@­Ó¶WÃBªº³æ¥\¯à²£«~©M¤Ó¥j®É¥Nª©ªº§K¶O¤u¨ã) 
autofs ¦³«Ü²M·¡ªº¤å¥ó¨Ã¥B§Ú¥Ñ°Jªº·PÁÂ¹ê§@ªº³o¨Ç¤H¡C
¨C¼ËªF¦è³£¦³ª©ÅvÁn©ú¡A«Ü©êºp§Ú¤£¯à´£¨Ñ¤@­Ó·PÁÂ²M³æ¡C






\subsection{§Ú¥i¥H¨ì­þ¸Ì¾Ç§ó¦hÃö©óÀÉ®×¨t²Î¦Û°Ê±¾¸üªº¸ê°T¡H}

¦³¤@­Ó autofs ªº¤Jªù¤â¥U¦b url url=" http://www.linuxhq.com/lg/issue24/nielsen.html"{$>$}¡C
¤]¥i¥H°Ñ¦Ò am-utils ¦b \nameurl{http://www.cs.columbia.edu/~ezk/am-utils}{}

(·PÁÂ³o¨Ç URL)

\end{document}
