% $Id: amq.tex,v 5.2 90/06/23 22:21:56 jsp Rel $
%
% Copyright (c) 1989 Jan-Simon Pendry
% Copyright (c) 1989 Imperial College of Science, Technology & Medicine
% Copyright (c) 1989 The Regents of the University of California.
% All rights reserved.
%
% This code is derived from software contributed to Berkeley by
% Jan-Simon Pendry at Imperial College, London.
%
% Redistribution and use in source and binary forms are permitted provided
% that: (1) source distributions retain this entire copyright notice and
% comment, and (2) distributions including binaries display the following
% acknowledgement:  ``This product includes software developed by the
% University of California, Berkeley and its contributors'' in the
% documentation or other materials provided with the distribution and in
% all advertising materials mentioning features or use of this software.
% Neither the name of the University nor the names of its contributors may
% be used to endorse or promote products derived from this software without
% specific prior written permission.
% THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
% WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%
%	@(#)amq.tex	5.1 (Berkeley) 7/19/90


\Chapter{Run-time Administration}\label{chapter:amq}

It is sometimes desirable or necessary to exercise external control
over some of \amd's internal state.  To support this requirement,
\amd\ implements an RPC interface which is used by the \amq\ program.

\Amq\ provides a variety of operations.  With no arguments, \amq\ obtains
a brief list of all existing mounts created by \amd.  This is different from
the list displayed by {\bf df}(1) since the latter only includes system
mount points.
The output from this option includes the following information:
\begin{itemize}
\item the automount point,
\item the filesystem type,
\item the mount map or mount information,
\item the internal, or system mount point.
\end{itemize}
For example:
\begin{verbatim}
/            auto  "root"                      sky:(pid75)
/homes       auto  /usr/local/etc/amd.homes    /homes
/home        auto  /usr/local/etc/amd.home     /home
/homes/jsp   nfs   charm:/home/charm           /a/charm/home/charm/jsp
/homes/phjk  nfs   toytown:/home/toytown       /a/toytown/home/toytown/ai/phjk
\end{verbatim}

The ``-m'' option displays similar information about mounted filesystems,
rather than automount points.  The output includes the following
information:
\begin{itemize}
\item the mount information,
\item the mount point,
\item the filesystem type,
\item the number of references to this filesystem,
\item the server hostname,
\item the state of the file server,
\item any error which has occured.
\end{itemize}
For example:
\begin{verbatim}
"root"             truth:(pid602)       auto 1 localhost is up
hesiod.home        /home                auto 1 localhost is up
hesiod.vol         /vol                 auto 1 localhost is up
hesiod.homes       /homes               auto 1 localhost is up
amy:/home/amy      /a/amy/home/amy      nfs  5 amy is up
gould:/home/gould  /a/gould/home/gould  nfs  0 gould is up (Permission denied)
noddy:/home/noddy  /a/noddy/home/noddy  nfs  0 noddy is down
\end{verbatim}
When the reference count is zero the filesystem is not mounted but
the mount point and server information is still being maintained
by \amd.

\Amq\ generally applies an operation, specified by a single letter option,
to a list of mount points.  The default operation is to obtain statistics
about each mount point.  This is similar to the output shown above
but includes information about the number and type of accesses to each
mount point.

By default the local host is used.  In an HP-UX cluster the root server
is used since that is the only place in the cluster where \amd\ will be running.
To query \amd\ on another host the ``-h'' option should be used.

The ``-u'' option causes the time-to-live interval of the named mount points
to be expired, thus causing an unmount attempt.  This is the only safe way
to unmount an automounted filesystem.
It is not possible to unmount a filesystem which has been mounted with
the {\tt notimeout} flag.

%The ``-H'' option informs \amd\ that the specified mount point has hung -
%as if its keepalive timer had expired.

The ``-s'' option displays global statistics.  If any other options are specified
or any filesystems named then this option is ignored.

The ``-f'' option causes \amd\ to flush the internal mount map cache.  This is
useful for YP and Hesiod maps since \amd\ will not notice when they
have been updated.

Three other operations are implemented.  These modify the state of
\amd\ as a whole, rather than any particular filesystem.
The ``-l'', ``-x'' and ``-D'' options have exactly the same effect
as \amd's corresponding command line options.  However, the ``-l''
option is rejected by \amd\ in version ``\VERSION''
for obvious security reasons.
