home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume21 / amd / part11 < prev    next >
Encoding:
Internet Message Format  |  1990-04-10  |  29.7 KB

  1. Subject:  v21i099:  An Automounter for NFS systems, Part11/13
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 406204c1 ea9a180e a3c79878 21b9316e
  5.  
  6. Submitted-by: Jan-Simon Pendry <jsp@doc.ic.ac.uk>
  7. Posting-number: Volume 21, Issue 99
  8. Archive-name: amd/part11
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 11 (of 13)."
  17. # Contents:  doc/amd.tex.2
  18. # Wrapped by rsalz@papaya.bbn.com on Tue Apr 10 15:12:15 1990
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'doc/amd.tex.2' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'doc/amd.tex.2'\"
  22. else
  23. echo shar: Extracting \"'doc/amd.tex.2'\" \(28104 characters\)
  24. sed "s/^X//" >'doc/amd.tex.2' <<'END_OF_FILE'
  25. XIf a filesystem type is to be heavily used, it may be worthwhile
  26. Xadding a new filesystem type into \amd, but for most uses the
  27. Xprogram filesystem should suffice.
  28. X
  29. XThe {\tt /n} convention says that each directory within {\tt /n} is the
  30. Xroot directory of the filesystems on a machine with the corresponding
  31. Xname.
  32. XSupposing a program, {\tt net-mount}, was available.  To provide
  33. Xan implementation of {\tt /n} the following map ({\tt net.map}) could be used:
  34. X\begin{quote}
  35. X\tt
  36. X{}*\ \ \ \ type:=program;mount:="/etc/net-mount mount \Var{key} \Var{fs}";\verb+\+ \\
  37. X\mbox{}\ \ \ \ \ unmount:="/etc/net-mount unmount \Var{key} \Var{fs}"
  38. X\end{quote}
  39. Xwhere {\tt argv[0]} is used to distinguish between mount and unmount requests;
  40. X{\tt argv[1]} is the name of the machine; {\tt argv[2]} is the local directory
  41. Xunder which to mount the filesystems.
  42. XThis could be started with the following command:
  43. X\begin{quote}
  44. X\tt
  45. Xamd ... /n net.map
  46. X\end{quote}
  47. X
  48. X\Section[Symbolic Link Filesystem]{Symbolic Link Filesystem ({\tt type:=link})}
  49. X
  50. XThe {\em link} filesystem type allows other parts of the filesystem
  51. Xto be referenced as if they were mounted under the automounter.
  52. XUnder SunOS 4.0 this can also be done using the loopback filesystem,
  53. Xhowever that adds an unnecessary extra mount into the system.
  54. X
  55. XOne common use for the symlink filesystem is {\tt /homes}
  56. Xwhich can be made to contain an entry for each user which points
  57. Xto their (auto-mounted) home directory.  Although this may seem
  58. Xrather expensive, it provides a great deal of administrative
  59. Xflexibility.
  60. X
  61. XThe \opt{fs} option specifies the destination of the link, as modified
  62. Xby the \opt{sublink} option.  If \opt{sublink} is specified, it
  63. Xis appended to \Var{fs}{\tt /} and the resulting string is used as the target.
  64. X
  65. X%\Amd\ keeps track of the local mount points on which it has mounted
  66. X%a filesystem.  If a second mount would be to the same local mount point,
  67. X%\amd\ converts that into a cross-reference to the original mount
  68. X%and the new mount is converted into a mount of type {\tt link}.
  69. X%References through either name will cause the time-to-live of the
  70. X%mount to be extended.
  71. X
  72. XAn example entry might be:
  73. X\begin{quote}
  74. X\tt
  75. Xjsp\ \ \ host==charm;type:=link;fs:=/home/charm;sublink:=jsp
  76. X\end{quote}
  77. X
  78. X\Section[Automount Filesystem]{Automount Filesystem ({\tt type:=auto})}\label{auto-fs}
  79. X
  80. XThe {\em auto} filesystem type allows a new automount point to
  81. Xbe added below an existing automount point.  The new mount point appears
  82. Xas a sub-directory of the original mount point.  This allows
  83. Xsome additional structure to be added,
  84. Xfor example to mimic the mount tree of another
  85. Xmachine.\footnote{
  86. XFuture work will allow a tree of automount points to be built by
  87. Xexamining the exported mount tree of a remote fileserver.}
  88. X
  89. XThe following option may be specified:
  90. X\begin{description}
  91. X\item[cache]\label{afs:cache}
  92. Xspecifies whether the data in this mount-map should be
  93. Xcached.  By default, no caching is done in order to conserve memory.
  94. XHowever, better performance and reliability can be obtained by caching
  95. Xsome or all of a mount-map.  If the cache option specifies {\tt all},
  96. Xthe entire map is enumerated when the mount point is created.
  97. XIf the cache option specifies {\tt inc}, caching is done incrementally
  98. Xas and when data is required.
  99. XSome map types do not support cache mode {\tt all}, in which case {\tt inc}
  100. Xis used whenever {\tt all} is requested.
  101. X
  102. XThe default cache mode is {\tt none} which means that no data will be cached.
  103. XEach mount map type has a default cache type, usually {\tt inc}, which
  104. Xcan be selected by specifying {\tt mapdefault}.
  105. X
  106. XThe cache mode for a mount map can only be selected on the command line.  Starting
  107. X\amd\ with the command
  108. X\begin{quote}
  109. X\tt
  110. Xamd /homes hesiod.homes -cache:=inc
  111. X\end{quote}
  112. Xwill cause {\tt /homes} to be automounted using the {\em Hesiod} name server with local
  113. Xincremental caching of all succesfully resolved names.
  114. X
  115. XAll cached data is forgotten whenever \amd\ receives
  116. Xa {\tt SIGHUP} signal.  If cache {\tt all} mode was selected, the
  117. Xcache will be reloaded.  This can be used to inform \amd\ that a map
  118. Xhas been updated.  In addition, whenever a cache lookup fails and \amd\ needs
  119. Xto examine a map, the map's modify time is examined.  If the cache is out
  120. Xof date with respect to the map then it is flushed as if a {\tt SIGHUP} had
  121. Xbeen received.
  122. X\end{description}
  123. X
  124. XThe \opt{fs} option specifies the name of the mount map to use for the new
  125. Xmount point.
  126. X%If the string ``{\tt .}'' is used then the same map is used;
  127. X%in addition the lookup prefix is set to the name of the mount point followed
  128. X%by a slash ``{\tt /}''.
  129. XThis is the same as specifying {\tt fs:=\$\{map\};pref:=\$\{key\}/}.
  130. XThe prefix can be overridden with the \opt{pref} option.
  131. XThe prefix alters the name that is looked up in the mount map.  If the
  132. Xprefix is non-null then it is prepended to the name requested by
  133. Xthe kernel before the map is searched.
  134. X
  135. XThe server {\tt dylan.doc.ic.ac.uk} has two user disks: {\tt /dev/dsk/2s0} and
  136. X{\tt /dev/dsk/5s0}.  These are accessed as {\tt /home/dylan/dk2} and
  137. X{\tt /home/dylan/dk5} respectively.  Since {\tt /home} is already an automount
  138. Xpoint, this naming is achieved with the following map entries:
  139. X\begin{quote}\raggedright
  140. X\tt
  141. Xdylan\ \ \ \ \ \ \ \ type:=auto;fs:=\Var{map};pref:=\Var{key}/ \\
  142. Xdylan/dk2\ \ \ \ type:=ufs;dev:=/dev/dsk/2s0 \\
  143. Xdylan/dk5\ \ \ \ type:=ufs;dev:=/dev/dsk/5s0
  144. X\end{quote}
  145. X
  146. X\Section[Direct Automount Filesystem]{Direct Automount Filesystem ({\tt type:=direct})}\label{direct-fs}
  147. X
  148. XThe {\em direct} filesystem is almost identical to the automount filesystem.
  149. XInstead of appearing to be a directory of mount points, it appears
  150. Xas a symbolic link to a mounted filesystem.  The mount is done at
  151. Xthe time the link is accessed.
  152. X
  153. XDirect automount points are created by specifying the {\tt direct} filesystem
  154. Xtype on the command line:
  155. X\begin{quote}
  156. X\tt
  157. Xamd ... /usr/man auto.direct -type:=direct
  158. X\end{quote}
  159. Xwhere {\tt auto.direct} would contain an entry such as:
  160. X\begin{quote}\raggedright
  161. X\tt
  162. Xusr/man\ \ \ \ -type:=nfs;rfs:=/usr/man \verb+\+ \\
  163. X\ \ \ \ \ \ \ \ \ \ \ rhost:=man-server1\ \ rhost:=man-server2
  164. X\end{quote}
  165. XIn this example, {\tt man-server1} and {\tt man-server2} are file servers
  166. Xwhich export copies of the manual pages.
  167. XNote that the key does {\em not} have a leading ``{\tt /}''.
  168. X
  169. X\Section{Error Filesystem}\label{error-fs}
  170. X
  171. XThe {\em error} filesystem type is used internally as a catch-all in
  172. Xthe case where none of the other filesystems was selected, or some other
  173. Xerror occurred.
  174. XLookups always fail with ``No such file or directory''.
  175. XAll other operations trivally succeed.
  176. X
  177. XThe error filesystem is not directly accessible.
  178. X
  179. X\Section{Inheritance Filesystem}\label{ifs}
  180. X
  181. XThe inheritance filesystem is not directly accessible.
  182. XInstead, internal mount nodes of this type are automatically generated
  183. Xwhen \amd\ is started with the ``-r'' option.
  184. XAt this time the system mount table ({\tt /etc/mtab}) is scanned to locate
  185. Xany filesystems which are already mounted.  If any reference to 
  186. Xthese filesystems is made through \amd\ then instead of attempting
  187. Xto mount it, \amd\ simulates the mount and {\em inherits} the
  188. Xfilesystem.  This allows a new version of \amd\ to be installed
  189. Xon a live system simply by killing the old daemon and starting
  190. Xthe new one.
  191. X
  192. X\Chapter{Run-time Administration}\label{chapter:amq}
  193. X
  194. XIt is sometimes desirable or necessary to exercise external control
  195. Xover some of \amd's internal state.  To support this requirement,
  196. X\amd\ implements an RPC interface which is used by the \amq\ program.
  197. X
  198. X\Amq\ provides a variety of operations.  With no arguments, \amq\ obtains
  199. Xa brief list of all existing mounts created by \amd.  This is different from
  200. Xthe list displayed by {\bf df}(1) since the latter only includes system
  201. Xmount points.
  202. XThe output from this option includes the following information:
  203. X\begin{itemize}
  204. X\item the automount point,
  205. X\item the filesystem type,
  206. X\item the mount map or mount information,
  207. X\item the internal, or system mount point.
  208. X\end{itemize}
  209. XFor example:
  210. X\begin{verbatim}
  211. X/            auto  "root"                      sky:(pid75)
  212. X/homes       auto  /usr/local/etc/amd.homes    /homes
  213. X/home        auto  /usr/local/etc/amd.home     /home
  214. X/homes/jsp   nfs   charm:/home/charm           /a/charm/home/charm/jsp
  215. X/homes/phjk  nfs   toytown:/home/toytown       /a/toytown/home/toytown/ai/phjk
  216. X\end{verbatim}
  217. X
  218. XThe ``-m'' option similar information about mounted filesystems,
  219. Xrather than automount points.  The output includes the following
  220. Xinformation:
  221. X\begin{itemize}
  222. X\item the mount information,
  223. X\item the mount point,
  224. X\item the filesystem type,
  225. X\item the number of references to this filesystem,
  226. X\item the server hostname,
  227. X\item the state of the file server,
  228. X\item any error which has occured.
  229. X\end{itemize}
  230. XFor example:
  231. X\begin{verbatim}
  232. X"root"                 truth:(pid602)           auto 1 localhost is up
  233. X../a_master5           /tmp/amd/junk            auto 1 localhost is up
  234. Xpelican:/home/pelican  /a/pelican/home/pelican  nfs  1 pelican is up
  235. Xtoytown:/home/toytown  /a/toytown/home/toytown  nfs  5 toytown is up
  236. Xgould:/home/gould      /a/gould/home/gould      nfs  0 gould is up (Permission denied)
  237. Xpebbles:/home/pebbles  /a/pebbles/home/pebbles  nfs  0 pebbles is down
  238. X\end{verbatim}
  239. XWhen the reference count is zero the filesystem is not mounted but
  240. Xthe mount point and server information is still being maintained
  241. Xby \amd.
  242. X
  243. X\Amq\ generally applies an operation, specified by a single letter option,
  244. Xto a list of mount points.  The default operation is to obtain statistics
  245. Xabout each mount point.  This is similar to the output shown above
  246. Xbut includes information about the number and type of accesses to each
  247. Xmount point.
  248. X
  249. XBy default the local host is used; in an HP-UX cluster the root server
  250. Xis used.
  251. XTo query \amd\ on another host the ``-h'' option should be used.
  252. X
  253. XThe ``-u'' option causes the time-to-live interval of the named mount points
  254. Xto be expired, thus causing an unmount attempt.  This is the only safe way
  255. Xto unmount an automounted filesystem.
  256. XIt is not possible to unmount a filesystem which has been mounted with
  257. Xthe {\tt notimeout} flag.
  258. X
  259. X%The ``-H'' option informs \amd\ that the specified mount point has hung -
  260. X%as if its keepalive timer had expired.
  261. X
  262. XThe ``-s'' option displays global statistics.  If any other options are specified
  263. Xor any filesystems named then this option is ignored.
  264. X
  265. XThe ``-f'' option causes \amd\ to flush the internal mount map cache.  This is
  266. Xuseful for YP and Hesiod maps since \amd\ does not normally notice when they
  267. Xhave been updated.
  268. X
  269. XThree other operations are implemented.  These modify the state of
  270. X\amd\ as a whole, rather than any particular filesystem.
  271. XThe ``-l'', ``-x'' and ``-D'' options have exactly the same effect
  272. Xas \amd's corresponding command line options.  However, the ``-l''
  273. Xoption is rejected by \amd\ in version ``\VERSION''
  274. Xfor obvious security reasons.
  275. X
  276. X
  277. X\Chapter{Examples}
  278. X
  279. X\Section{User Filesystems}
  280. XWith more than one fileserver, the directories most frequently
  281. Xcross-mounted are those containing user home directories.
  282. XA common convention used at Imperial College is to mount
  283. Xthe user disks under {\tt /home/}{\em machine}.
  284. XTypically, the {\tt /etc/fstab} file\footnote{{\tt /etc/checklist}
  285. Xon System V} contained a long list of entries
  286. Xsuch as:
  287. X\begin{quote}
  288. X{\em machine}{\tt :/home/}{\em machine}\ \ \tt /home/{\em machine}\ nfs \ldots
  289. X\end{quote}
  290. Xfor each fileserver on the network.
  291. X
  292. XThere are numerous problems with this system.
  293. XThe mount list can become quite large, or some of the machines
  294. Xmay be down when a system is booted.
  295. XWhen a new fileserver is installed, {\tt /etc/fstab} must be
  296. Xupdated on every machine, the mount directory created and
  297. Xthe filesystem mounted.
  298. XIn research environments most
  299. Xpeople use the same few workstations, but it is convenient to go
  300. Xto a colleague's machine and access your own files.
  301. XWhen a server goes down, it can cause a process on a client machine to
  302. Xhang.  By minimising the mounted filesystems to only include those
  303. Xactively being used, there is less chance that a filesystem will be mounted
  304. Xwhen a server goes down.
  305. X
  306. XThe following is a short extract from a map taken from a research fileserver
  307. Xat Imperial College:
  308. X\begin{verbatim}
  309. X/defaults       opts:=rw,intr,grpid,nosuid
  310. Xcharm           host!=${key};type:=nfs;rhost:=${key};rfs:=/home/${key} \
  311. X                host==${key};type:=ufs;dev:=/dev/xd0g
  312. X#
  313. X...
  314. X
  315. X#
  316. X# dylan has two user disks so have a
  317. X# top directory in which to mount them.
  318. X#
  319. Xdylan           type:=auto;fs:=${map};pref:=${key}/
  320. X#
  321. Xdylan/dk2       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/${key} \
  322. X                host==dylan;type:=ufs;dev:=/dev/dsk/2s0
  323. X#
  324. Xdylan/dk5       host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/${key} \
  325. X                host==dylan;type:=ufs;dev:=/dev/dsk/5s0
  326. X...
  327. X#
  328. Xtoytown         host!=${key};type:=nfs;rhost:=${key};rfs:=/home/${key} \
  329. X                host==${key};type:=ufs;dev:=/dev/xy1g
  330. X#
  331. Xzebedee         host!=${key};type:=nfs;rhost:=${key};rfs:=/home/${key} \
  332. X                host==${key};type:=ufs;dev:=/dev/dsk/1s0
  333. X#
  334. X# Just for access...
  335. X#
  336. Xgould           type:=auto;fs:=${map};pref:=${key}/
  337. Xgould/staff     host!=gould;type:=nfs;rhost:=gould;rfs:=/home/${key}
  338. X#
  339. Xgummo           host!=${key};type:=nfs;rhost:=${key};rfs:=/home/${key}
  340. X...
  341. X\end{verbatim}
  342. X
  343. XThis map is shared by most of the machines listed so on those
  344. Xsystems any of the user disks is accessible via a consistent name.
  345. X
  346. XNote that when mounting a remote filesystem, the {\em automounted}
  347. Xmount point is referenced, so that the filesystem will be mounted if
  348. Xit is not yet (at the time the remote mountd obtains the file handle).
  349. X
  350. X\Section{Home Directories}
  351. XOne convention for home directories is to locate them in {\tt /homes} so
  352. Xuser {\tt jsp}'s home directory is {\tt /homes/jsp}.
  353. XWith more than a single fileserver it is convenient
  354. Xto spread user files across several machines.
  355. XAll that is required is a mount-map
  356. Xwhich converts login names to an automounted directory.
  357. X
  358. XSuch a map might be started by the command:
  359. X\begin{quote}
  360. X\tt amd /homes amd.homes
  361. X\end{quote}
  362. Xwhere the map {\tt amd.homes} contained the entries:
  363. X\begin{quote}\raggedright
  364. X\tt
  365. X/defaults\ \ \ type:=link\ \ \ \# All the entries are of type:=link \\
  366. Xjsp\ \ \ \ \ \ \ \ \ fs:=/home/charm/jsp\\
  367. Xnjw\ \ \ \ \ \ \ \ \ fs:=/home/dylan/dk5/njw\\
  368. X...\\
  369. Xphjk\ \ \ \ \ \ \ \ fs:=/home/toytown/ai/phjk\\
  370. Xsjv\ \ \ \ \ \ \ \ \ fs:=/home/ganymede/sjv
  371. X\end{quote}
  372. XWhenever a login name is accessed in {\tt /homes} a symbolic link
  373. Xappears pointing to the real location of that user's home directory.
  374. XIn this example, {\tt /homes/jsp} would appear to be a symbolic link
  375. Xpointing to {\tt /home/charm/jsp}.
  376. XOf course, {\tt /home} would also be an automount point.
  377. X
  378. XThis system causes an extra level of symbolic links to be used.
  379. XAlthough that turns out to be relatively inexpensive, an alternative is
  380. Xto directly mount the required filesystems in the {\tt /homes}
  381. Xmap.  The required map is simple, but long, and its creation best automated.
  382. XThe entry for {\tt jsp} could be:
  383. X{\tt\begin{tabbing}
  384. Xjsp\ \ \ \ \ \ \= -sublink:=\$\{key\};rfs:=/home/charm {\verb+\+}\kill \\
  385. Xjsp            \> -sublink:=\$\{key\};rfs:=/home/charm {\verb+\+}\\
  386. X               \> host==charm;type:=ufs;dev:=/dev/xd0g {\verb+\+}\\
  387. X               \> host!=charm;type:=nfs;rhost:=charm
  388. X\end{tabbing}}
  389. X
  390. XThis map can become quite big if it contains a large number of
  391. Xentries.  By combining two other features of \amd\ it can be greatly
  392. Xsimplified.  First the \UFS\ partitions should be mounted under the
  393. Xcontrol of {\tt /etc/fstab}, taking care that they are mounted in the
  394. Xsame place that \amd\ would have automounted them.
  395. XThe map can then be changed to:
  396. X\begin{quote}\raggedright
  397. X\tt
  398. X/defaults\ \ \ \ type:=nfs;sublink:=\Var{key};opts:=rw,intr,nosuid,grpid\\
  399. Xjsp\ \ \ \ \ \ \ \ \ \ rhost:=charm;rfs:=/home/charm\\
  400. Xnjw\ \ \ \ \ \ \ \ \ \ rhost:=dylan;rfs:=/home/dylan/dk5\\
  401. X...\\
  402. Xphjk\ \ \ \ \ \ \ \ \ rhost:=toytown;rfs:=/home/toytown;sublink:=ai/\Var{key}\\
  403. Xsjv\ \ \ \ \ \ \ \ \ \ rhost:=ganymede;rfs:=/home/ganymede
  404. X\end{quote}
  405. X
  406. XThis map operates as usual on a remote machine (ie \Var{host} $\not=$ \Var{rhost}).
  407. XOn the machine where the filesystem is stored (ie \Var{host} $=$ \Var{rhost}),
  408. X\amd\ will construct a local filesystem mount point which corresponds to
  409. Xthe name of the locally mounted \UFS\ partition.  If \amd\ is started
  410. Xwith the ``-r'' option then instead of attempting an \NFS\ mount, \amd\ will
  411. Xsimply inherit the \UFS\ mount (\see \Ref{ifs}).
  412. X
  413. X%\Section{System Filesystem}
  414. X
  415. X\Section{Architecture Sharing}
  416. X%At the moment some of the research machines have sets of software
  417. X%mounted in {\tt /vol}.  This contains subdirectories for \TeX,
  418. X%system sources, local sources, prolog libraries and so on.
  419. XOften a filesystem will be shared by machines of different architectures.
  420. XSeparate trees can be maintained for the executable images for each
  421. Xarchitecture, but it may be more convenient to have a shared tree,
  422. Xwith distinct subdirectories.
  423. X
  424. XA shared tree might have the following structure on the fileserver (called
  425. X{\tt fserver} in the example):
  426. X\begin{quote}\raggedright
  427. X\tt
  428. Xlocal/tex \\
  429. Xlocal/tex/fonts \\
  430. Xlocal/tex/lib \\
  431. Xlocal/tex/bin \\
  432. Xlocal/tex/bin/sun3 \\
  433. Xlocal/tex/bin/sun4 \\
  434. Xlocal/tex/bin/hp9000 \\
  435. X...
  436. X\end{quote}
  437. XIn this example, the subdirectories of {\tt local/tex/bin} should be
  438. Xhidden when accessed via the automount point (conventionally {\tt /vol}).
  439. XA mount-map for {\tt /vol} to achieve this would look like:
  440. X{\tt\begin{tabbing}
  441. Xtex/fonts\ \ \ \ \ \= \kill \\
  442. X/defaults          \> rfs:=/vol;sublink:=\$\{key\};rhost:=fserver;type:=link\\
  443. Xtex                \> type:=auto;fs:=\$\{map\};pref:=\$\{key\}/\\
  444. Xtex/fonts          \> host!=fserver;type:=nfs\ {\verb+\+}\\
  445. X                   \> host==fserver;fs:=/usr/local \\
  446. Xtex/lib            \> host!=fserver;type:=nfs\ {\verb+\+}\\
  447. X                   \> host==fserver;fs:=/usr/local \\
  448. Xtex/bin            \> -sublink:=\$\{key\}/\$\{arch\} host!=fserver;type:=nfs\ {\verb+\+}\\
  449. X                   \> host:=fserver;fs:=/usr/local
  450. X\end{tabbing}}
  451. XWhen {\tt /vol/tex/bin} is referenced, the current machine architecture
  452. Xis automatically appended to the path by the \Var{sublink} variable.
  453. XThis means that users can have {\tt /vol/tex/bin} in their {\tt PATH}
  454. Xwithout concern for architecture dependencies.
  455. X
  456. X\Section{Wildcard names \& Replicated Servers}
  457. XBy using the wildcard facility, \amd\ can {\em overlay} an existing
  458. Xdirectory with additional entries.
  459. XThe system files are usually mounted under {\tt /usr}.  If instead
  460. X\amd\ is mounted on {\tt /usr}, additional
  461. Xnames can be overlayed to augment or replace names in the ``master'' {\tt /usr}.
  462. XA map to do this would have the form:
  463. X{\tt\begin{tabbing}
  464. Xlocal\ \ \ \ \ \= blah \kill \\
  465. Xlocal          \> type:=auto;fs:=local-map\\
  466. Xshare          \> type:=auto;fs:=share-map\\
  467. X{}*            \> -type:=nfs;rfs:=/export/exec/\$\{arch\};sublink:="\$\{key\}"\ \verb+\+\\
  468. X               \> \ \ \ \ rhost:=fserv1\ \ rhost:=fserv2\ \ rhost:=fserv3 \\
  469. X\end{tabbing}}
  470. XNote that the assignment to \Var{sublink} is surrounded by double quotes to
  471. Xprevent the incoming key from causing the map to be misinterpreted.
  472. XThis map has the effect of directing any access to {\tt /usr/local} or {\tt /usr/share}
  473. Xto another automount point.
  474. XIn this example, it is assumed that the {\tt /usr} files are replicated on
  475. Xthree fileservers: {\tt fserv1}, {\tt fserv2} and {\tt fserv3}.
  476. XFor any references other than to {\tt local}
  477. Xand {\tt share} one of the servers is used and a symbolic link to
  478. X{\tt \Var{autodir}/\Var{rhost}/export/exec/\Var{arch}/}{\em whatever}
  479. Xis returned once an appropriate filesystem has been mounted.
  480. X
  481. X\Chapter{Internals}
  482. X
  483. X\Section{Log Messages}
  484. X
  485. XIn the following sections a brief explanation is given of some
  486. Xof the log messages made by \amd.
  487. XWhere the message is in {\tt typewriter} font, it corresponds
  488. Xexactly to the message produced by \amd.  Words in {\em italic}
  489. Xare replaced by an appropriate string.  Variables, \Var{{\em var}},
  490. Xindicate that the value of the appropriate variable is output.
  491. X
  492. XLog messages are either sent direct to a file,
  493. Xor logged via the {\bf syslog}(3) mechanism.
  494. XMessages are logged with facility {\tt LOG\_DAEMON} when using {\bf syslog}(3).
  495. XIn either case, entries in the file are of the form:
  496. X\begin{quote}
  497. X{\em Unix-date}\ \ {\em hostname} {\tt amd[}{\em pid}{\tt ]}\ \ {\em message}
  498. X\end{quote}
  499. X
  500. X\Subsection{Fatal errors}
  501. X\Amd\ attempts to deal with unusual events.
  502. XWhenever it is not possible to deal with such an error, \Amd\ will
  503. Xlog an appropriate message and, if it cannot possibly continue, will
  504. Xeither exit or abort.
  505. XThese messages are selected by {\tt -x~fatal} on the command line.
  506. XWhen {\bf syslog}(3) is being used, they are logged with
  507. Xlevel {\tt LOG\_FATAL}.
  508. XEven if \amd\ continues to operate it is likely to remain in a precarious
  509. Xstate and should be restarted at the earliest opportunity.
  510. X
  511. X\begin{description}
  512. X\item [\tt Attempting to inherit not-a-filesystem]\mbox{}\\
  513. XThe prototype mount point created during a filesystem restart
  514. Xdid not contain a reference to the restarted filesystem.
  515. XThis is a ``should never happen'' error.
  516. X
  517. X\item [\tt Can't bind to domain "{\em yp-domain}"]\mbox{}\\
  518. XA specific YP domain was requested on the command line, but no
  519. Xserver for that domain is available on the local net.
  520. X
  521. X\item [\tt Can't determine IP address of this host ({\em hostname})]\mbox{}\\
  522. XWhen \amd\ starts it determines its own IP address.
  523. XIf this lookup fails then \amd\ cannot continue.
  524. XThe hostname it looks up is that obtained returned by
  525. X{\bf gethostname}(2) system call.
  526. X
  527. X\item [\tt Can't find root file handle for {\em automount point}]\mbox{}\\
  528. X\Amd\ creates its own file handles for the automount points.
  529. XWhen it mounts itself as a server, it must pass these
  530. Xfile handles to the local kernel.
  531. XIf the filehandle is not obtainable the mount point is ignored.
  532. XThis is a ``should never happen'' error.
  533. X
  534. X\item [\tt Must be root to mount filesystems (euid = {\em euid})]\mbox{}\\
  535. XTo prevent embarrassment, \amd\ makes sure it has appropriate
  536. Xsystem priviledges.  This amounts to having an euid of 0.
  537. XThe check is made after argument processing complete to
  538. Xgive non-root users a chance to access the ``-v'' option.
  539. X
  540. X\item [\tt No work to do - quitting]\mbox{}\\
  541. XNo automount points were given on the command line and so
  542. Xthere is no work to do.
  543. X
  544. X\item [\tt Out of memory in realloc]\mbox{}\\
  545. XWhile attempting to realloc some memory, the memory space
  546. Xavailable to \amd\ was exhausted.  This is an unrecoverable
  547. Xerror.
  548. X
  549. X\item [\tt Out of memory]\mbox{}\\
  550. XWhile attempting to maalloc some memory, the memory space
  551. Xavailable to \amd\ was exhausted.  This is an unrecoverable
  552. Xerror.
  553. X
  554. X\item [\tt cannot create rpc/udp service]\mbox{}\\
  555. XEither the NFS or AMQ endpoint could not be created.
  556. X
  557. X\item [\tt gethostname:\ {\em description}]\mbox{}\\
  558. XThe {\bf gethostname}(2) system call failed during startup.
  559. X
  560. X\item [\tt host name is not set]\mbox{}\\
  561. XThe {\bf gethostname}(2) system call returned a zero length
  562. Xhost name.
  563. XThis can happen if \amd\ is started in single user mode just
  564. Xafter booting the system.
  565. X
  566. X\item [\tt ifs\_match called!]\mbox{}\\
  567. XAn internal error occurred while restarting a pre-mounted
  568. Xfilesystem.
  569. XThis is a ``should never happen'' error.
  570. X
  571. X\item [\tt mount\_afs:\ {\em description}]\mbox{}\\
  572. XAn error occured while \amd\ was mounting itself.
  573. X
  574. X\item [\tt run\_rpc failed]\mbox{}\\
  575. XSomehow the main NFS server loop failed.
  576. XThis is a ``should never happen'' error.
  577. X
  578. X\item [\tt unable to free rpc arguments in amqprog\_1]\mbox{}\\
  579. XThe incoming arguments to the AMQ server could not be
  580. Xfree'ed.
  581. X
  582. X\item [\tt unable to free rpc arguments in nfs\_program\_1]\mbox{}\\
  583. XThe incoming arguments to the NFS server could not be
  584. Xfree'ed.
  585. X
  586. X\item [\tt unable to register (AMQ\_PROGRAM, AMQ\_VERSION, udp)]\mbox{}\\
  587. XThe AMQ server could not be registered with the local portmapper
  588. Xor the internal RPC dispatcher.
  589. X
  590. X\item [\tt unable to register (NFS\_PROGRAM, NFS\_VERSION, 0)]\mbox{}\\
  591. XThe NFS server could not be registered with the internal RPC dispatcher.
  592. X
  593. X\end{description}
  594. X
  595. X\Subsection{Info messages}
  596. X\Amd\ generates information messages to record state changes.
  597. XThese messages are selected by {\tt -x~info} on the command line.
  598. XWhen {\bf syslog}(3) is being used, they are logged with
  599. Xlevel {\tt LOG\_INFO}.
  600. XThe messages listed below can be generated
  601. Xand are in a format suitable for simple statistical analysis.
  602. X``{\em mount-info}'' is the string that is displayed by \amq\ in its mount
  603. Xinformation column and placed in the system mount table.
  604. X\begin{description}
  605. X\item[\tt mount of "\Var{path}" on \Var{fs} timed out]\mbox{}\\
  606. XAttempts to mount a filesystem for the given automount point have failed
  607. Xto complete within 30 seconds.
  608. X
  609. X\item[\tt "\Var{path}" forcibly timed out]\mbox{}\\
  610. XAn automount point has been timed out by the \amq\ command.
  611. X
  612. X\item[\tt restarting {\em mount-info} on \Var{fs}]\mbox{}\\
  613. XA pre-mounted file system has been noted.
  614. X
  615. X\item[\tt "\Var{path}" has timed out]\mbox{}\\
  616. XNo access to the automount point has been made within the timeout period.
  617. X
  618. X\item[\tt file server \Var{rhost} is down - timeout of "\Var{path}" ignored]\mbox{}\\
  619. XAn automount point has timed out, but the corresponding file server is known to be down.
  620. XThis message is only produced once for each mount point for which the server is down.
  621. X
  622. X\item[\tt Re-synchronizing cache for map \Var{map}]\mbox{}\\
  623. XThe named map has been modified and the internal cache is being re-synchronized.
  624. X
  625. X\item[\tt Filehandle denied for "\Var{rhost}:\Var{rfs}"]\mbox{}\\
  626. XThe mount daemon refused to return a file handle for the requested filesystem.
  627. X
  628. X\item[\tt Filehandle error for \Var{path}:\Var{rfs}":\ {\em description}]\mbox{}\\
  629. XThe mount daemon gave some other error for the requested filesystem.
  630. X
  631. X\item[\tt {\em mount-info} restarted fstype \Var{type} on \Var{fs}]\mbox{}\\
  632. X\Amd\ is using a pre-mounted filesystem to satisfy a mount request.
  633. X
  634. X\item[\tt file server \Var{rhost} type nfs starts up]\mbox{}\\
  635. XA new \NFS\ file server has been referenced and is known to be up.
  636. X
  637. X\item[\tt file server \Var{rhost} type nfs starts down]\mbox{}\\
  638. XA new \NFS\ file server has been referenced and is known to be down.
  639. X
  640. X\item[\tt file server \Var{rhost} type nfs is up]\mbox{}\\
  641. XAn \NFS\ file server that was previously down is now up.
  642. X
  643. X\item[\tt file server \Var{rhost} type nfs is down]\mbox{}\\
  644. XAn \NFS\ file server that was previously up is now down.
  645. X
  646. X\item[\tt Finishing with status {\em exit-status}]\mbox{}\\
  647. X\Amd\ is about to exit with the given exit status. 
  648. X
  649. X\item[\tt {\em mount-info} mounted fstype \Var{type} on \Var{fs}]\mbox{}\\
  650. XA new file system has been mounted.
  651. X
  652. X\item[\tt {\em mount-info} unmounted fstype \Var{type} from \Var{fs}]\mbox{}\\
  653. XA file system has been unmounted.
  654. X
  655. X\item[\tt {\em mount-info} unmounted fstype \Var{type} from \Var{fs} link \Var{fs}/\Var{sublink}]\mbox{}\\
  656. XA file system of which only a sub-directory was in use has been unmounted.
  657. X
  658. X\end{description}
  659. X
  660. X\Chapter*{Acknowledgements \& Trademarks}
  661. X\addcontentsline{toc}{chapter}{Acknowledgements \& Trademarks}
  662. XThanks to the Formal Methods Group at Imperial College for
  663. Xsuffering patiently while \amd\ was being developed on their machines.
  664. X
  665. XThanks to the many people who have helped with the development
  666. Xof \amd\, especially Piete Brooks at the Cambridge University Computing Lab for
  667. Xmany hours of testing, experimentation and discussion and who also provided
  668. Xthe RISC iX and Ultrix ports.
  669. X
  670. X\begin{trivlist}
  671. X\item[{\sf DEC}, {\sf VAX} and {\sf Ultrix}]
  672. X are registered trademarks of Digital Equipment Corporation.
  673. X\item[{\sf IBM}]
  674. Xis a registered trademark of International Business Machines Corporation.
  675. X\item[{\sf Sun}, {\sf NFS} and {\sf SunOS}]
  676. Xare registered trademarks of Sun Microsystems, Inc.
  677. X\item[{\sf Unix}]
  678. Xis a registered trademark of AT\&T Bell Laboratories in
  679. Xthe USA and other countries.
  680. X\item[{\sf UTX}]
  681. Xis a registered trademark of Gould, Inc.
  682. X\end{trivlist}
  683. X
  684. X\bibliographystyle{ieeetr}
  685. X\bibliography{amd}
  686. X
  687. X\addcontentsline{toc}{chapter}{Bibliography}
  688. X
  689. X%\newpage
  690. X%\input index
  691. X
  692. X\end{document}
  693. END_OF_FILE
  694. if test 28104 -ne `wc -c <'doc/amd.tex.2'`; then
  695.     echo shar: \"'doc/amd.tex.2'\" unpacked with wrong size!
  696. fi
  697. # end of 'doc/amd.tex.2'
  698. fi
  699. echo shar: End of archive 11 \(of 13\).
  700. cp /dev/null ark11isdone
  701. MISSING=""
  702. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  703.     if test ! -f ark${I}isdone ; then
  704.     MISSING="${MISSING} ${I}"
  705.     fi
  706. done
  707. if test "${MISSING}" = "" ; then
  708.     echo You have unpacked all 13 archives.
  709.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  710. else
  711.     echo You still need to unpack the following archives:
  712.     echo "        " ${MISSING}
  713. fi
  714. ##  End of shell archive.
  715. exit 0
  716. exit 0 # Just in case...
  717.