1.\" 2.\" Copyright (c) 1997-2006 Erez Zadok 3.\" Copyright (c) 1990 Jan-Simon Pendry 4.\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine 5.\" Copyright (c) 1990 The Regents of the University of California. 6.\" All rights reserved. 7.\" 8.\" This code is derived from software contributed to Berkeley by 9.\" Jan-Simon Pendry at Imperial College, London. 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions 13.\" are met: 14.\" 1. Redistributions of source code must retain the above copyright 15.\" notice, this list of conditions and the following disclaimer. 16.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" notice, this list of conditions and the following disclaimer in the 18.\" documentation and/or other materials provided with the distribution. 19.\" 3. All advertising materials mentioning features or use of this software 20.\" must display the following acknowledgment: 21.\" This product includes software developed by the University of 22.\" California, Berkeley and its contributors. 23.\" 4. Neither the name of the University nor the names of its contributors 24.\" may be used to endorse or promote products derived from this software 25.\" without specific prior written permission. 26.\" 27.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37.\" SUCH DAMAGE. 38.\" 39.\" %W% (Berkeley) %G% 40.\" 41.\" $Id: amq.8,v 1.15.2.1 2006/01/02 18:48:24 ezk Exp $ 42.\" $FreeBSD$ 43.\" 44.Dd January 2, 2006 45.Dt AMQ 8 46.Os 47.Sh NAME 48.Nm amq 49.Nd automounter query tool 50.Sh SYNOPSIS 51.Nm 52.Op Fl fmpsvwHTU 53.Op Fl h Ar hostname 54.Op Fl l Ar log_file 55.Op Fl x Ar log_options 56.Op Fl D Ar debug_options 57.Op Fl P Ar program_number 58.Op Oo Fl u Oc Ar directory ... 59.Sh DESCRIPTION 60The 61.Nm 62utility 63provides a simple way of determining the current state of the 64.Xr amd 8 65program. 66Communication is by 67.Tn RPC . 68Three modes of operation are supported by the current protocol. 69By default 70a list of mount points and auto-mounted file systems is output. 71An 72alternative host can be specified using the 73.Fl h 74option. 75.Pp 76If 77.Ar directory 78names are given, as output by default, then per file system 79information is displayed. 80.Sh OPTIONS 81.Bl -tag -width indent 82.It Fl f 83Ask the automounter to flush the internal caches and reload all the maps. 84.It Fl h Ar hostname 85Specify an alternate host to query. 86By default the local host is used. 87In 88an 89.Tn HP-UX 90cluster, the root server is queried by default, since that is the system on 91which the automounter is normally run. 92.It Fl l Ar log_file 93Tell 94.Xr amd 8 95to use 96.Ar log_file 97as the log file name. 98For security reasons, this must be the same log file 99which 100.Xr amd 8 101used when started. 102This option is therefore only useful to 103refresh 104.Nm amd Ns 's 105open file handle on the log file, so that it can be rotated 106and compressed via daily cron jobs. 107.It Fl m 108Ask the automounter to provide a list of mounted file systems, including the 109number of references to each file system and any error which occurred while 110mounting. 111.It Fl p 112Return the process ID of the remote or locally running 113.Xr amd 8 . 114Useful when you 115need to send a signal to the local 116.Xr amd 8 117process, and would rather not have to 118search through the process table. 119This option is used in the 120.Pa ctl-amd 121script. 122.It Fl s 123Ask the automounter to provide system-wide mount statistics. 124.It Fl u 125Ask the automounter to unmount the file systems named in 126.Ar directory 127instead of providing 128information about them. 129Unmounts are requested, not forced. 130They merely 131cause the mounted file system to timeout, which will be picked up by 132.Nm amd Ns 's 133main scheduler thus causing the normal timeout action to be taken. 134.It Fl v 135Ask the automounter for its version information. 136This is a subset of the 137information output by 138.Xr amd 8 Ns 's 139.Fl v 140option. 141.It Fl w 142Translate a full pathname as returned by 143.Xr getcwd 3 144into a short 145.Xr amd 8 146pathname that goes through its mount points. 147This option requires that 148.Xr amd 8 149is running. 150.It Fl x Ar log_options 151Ask the automounter to use the logging options specified in 152.Ar log_options 153from now on. 154.It Fl D Ar debug_options 155Ask the automounter to use the debugging options specified in 156.Ar debug_options 157from now on. 158.It Fl H 159Display short usage message. 160.It Fl P Ar program_number 161Contact an alternate running 162.Xr amd 8 163that had registered itself on a different 164.Tn RPC 165.Ar program_number 166and apply all other operations to that instance of the automounter. 167This is 168useful when you run multiple copies of 169.Xr amd 8 , 170and need to manage each 171one separately. 172If not specified, 173.Nm 174will use the default program number for 175.Xr amd 8 , 176300019. 177For security reasons, the only alternate program numbers 178.Xr amd 8 179can use range from 300019 to 300029, inclusive. 180.It Fl T 181Contact 182.Xr amd 8 183using the TCP transport only. 184Normally 185.Nm 186will try TCP, and if that failed, will try UDP. 187.It Fl U 188Contact 189.Xr amd 8 190using UDP (connectionless) transport only. 191Normally 192.Nm 193will try TCP, and if that failed, will try UDP. 194.El 195.Sh FILES 196.Bl -tag -width ".Pa amq.x" -compact 197.It Pa amq.x 198.Tn RPC 199protocol description. 200.El 201.Sh CAVEATS 202The 203.Nm 204utility 205uses a Sun registered 206.Tn RPC 207program number (300019 decimal) which may not 208be in the 209.Xr rpc 5 210database. 211.Pp 212If the TCP wrappers library is available, and the 213.Va use_tcpwrappers 214global 215.Xr amd.conf 5 216option is set to 217.Dq Li yes , 218then 219.Xr amd 8 220will verify that the host running 221.Nm 222is authorized to connect. 223The 224.Dq Li amd 225service name must be used in the 226.Pa /etc/hosts.allow 227and 228.Pa /etc/hosts.deny 229files. 230For example, to allow only localhost to connect to 231.Xr amd 8 , 232add this line to 233.Pa /etc/hosts.allow : 234.Pp 235.Dl "amd: localhost" 236.Pp 237and this line to 238.Pa /etc/hosts.deny : 239.Pp 240.Dl "amd: ALL" 241.Sh SEE ALSO 242.Xr amd.conf 5 , 243.Xr hosts_access 5 , 244.Xr amd 8 245.Pp 246.Dq am-utils 247.Xr info 1 248entry. 249.Rs 250.%A Erez Zadok 251.%B "Linux NFS and Automounter Administration" 252.%O ISBN 0-7821-2739-8 253.%I Sybex 254.%D 2001 255.Re 256.Pp 257.Pa http://www.am-utils.org/ 258.Rs 259.%T Amd \- The 4.4 BSD Automounter 260.Re 261.Sh HISTORY 262The 263.Nm 264utility 265first appeared in 266.Bx 4.4 . 267.Sh AUTHORS 268.An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , 269Department of Computing, Imperial College, London, UK. 270.Pp 271.An Erez Zadok Aq ezk@cs.sunysb.edu , 272Computer Science Department, Stony Brook 273University, Stony Brook, New York, USA. 274.Pp 275Other authors and contributors to 276.Nm am-utils 277are listed in the 278.Pa AUTHORS 279file distributed with 280.Nm am-utils . 281