1Installation Notes for Amd. 2 3NOTE: Please read all of this before starting. 4 It is not very long and may save you time in the long term. 5 61. ``Getting started...'' 7 8If you don't know what an Automounter does for you then read the 9documentation in doc/amdref.texinfo. You can either use TeX to print 10it out or read it directly using the GNU info package. 11 122. ``Find out what version of UN*X you are running...'' 13 14To install Amd you need a port for your version of UN*X. In the 15config/ directory are several files called os-*.h. One of these 16should correspond to your version of UN*X. Run the program 17"config/os-type" to find out what system Amd thinks you have. Check 18the correspondong config/os-??? file to make sure that you and Amd are 19in agreement. If os-type returns "unknown" then either no-one has yet 20done a port, or your version of UN*X is so braindead that a port is 21not possible (e.g. System V without reliable signals). The current 22known operating systems (grouped by architecture) are: 23 24 acis43 (AOS) ACIS 4.3BSD on an IBM RT 25 aix3 AIX 3.2 26 aux Apple A/UX 27 bsd44 4.4 BSD on whatever 28 concentrix Concentrix on an Alliant 29 dgux Data General AViiON 30 fpx4 Celerity FPX 4.1/2 31 hlh42 4.2 BSD on HLH Orion 1/05 32 hpux HP-UX 6.* and 7.* on a HP9000/300 33 irix3 SGI Iris 34 irix4 SGI Iris w/Irix 4.0.x 35 next NeXT 36 riscix 4.3 BSD on an Acorn Archimedes 37 sos3, sos4 SunOS 3.* and 4.* on a Sun-3 and Sun-4 38 u2_2 Ultrix 2.2 (or 2.*?) on a VAX (broken) 39 u3_0 Ultrix 3.0 (or 3.*?) on a VAX (broken) 40 u4_2 Ultrix 4.2 41 umax43 4.3 BSD on an Encore Multimax 42 xinu43 More/BSD (4.3 BSD) on a VAX or HP9000/300 43 44 + some others... 45 46If you do define a new operating system type foo, you may need to create a 47file called Makefile.foo which defines the special Makefile parameters. 48 493. ``Hacking the Makefile...'' 50 51Amd tries very hard to determine what type of machine you are using 52and how best to compile itself. If this does not work then you will 53have to find some heuristic which can differentiate your 54configuration. You may need to edit "config/arch" and 55"config/os-type". If you do make sure your changes can cope if 56/etc/motd is missing and please send it to the address below. 57 58To check whether things are working, run: 59 sh config/arch 60 sh config/os-type 61 62You may care to tailor some site specific preferences in "Makefile.com". The 63variables most likely to be changes are at the top. Any changes should be 64added to a file called config/Makefile.local (if they are applicable to all 65operating systems at your site) or Makefile.local.foo (where foo is the OS type 66as determined in part 2). 67 68Additionally, some configuration options may be altered in 69"config/Makefile.config". This means that you should not need to edit any 70distributed files apart from "config/Makefile.config". As a minimum, you 71should check: 72 73* You are using the correct C compiler. Amd, as shipped, does not use GCC. 74 Note that using GCC version 1.34 or later (e.g. 1.36) gives structure 75 passing problems with some parts of Sun's RPC library at least on Sun-4's. 76 The current workaround is to use the system CC to compile the part of the 77 automounter that gets hit by this problem. [[This is not the same problem 78 that is fixed by -fpcc-struct-return.]] Amd contains no "register" 79 declarations, so using old PCC based code generators is probably bad news. 80 81 To use GNU CC, add the following to config/Makefile.local{.os-type}: 82 83 CC = gcc ${GCCOPTS} 84 85* The installation directory (ETC) is set up correctly. 86 87* If you are running tests then it may be worth switching on the DEBUG flag 88 which will cause a running commentary to be printed to the log file. To 89 compile in the debug code, add the following to 90 config/Makefile.local{.os-type}: 91 92 DEBUG = -DDEBUG 93 CCOPTS = -g 94 95 The -g option will also allow you to use gdb. Using dbx is not advisable 96 since it puts a breakpoint on exit() which causes all of Amd's child 97 processes to dump core. gdb does not suffer from this problem. 98 994. ``Build the executable...'' 100 101Now you need to compile the automounter. To do this you type: 102 103 make 104 105in the top-level directory. You can also go into each of the program 106directories and just run make there. 107 108If you are porting to a new machine you may want to do: 109 110 make OS=foo 111 112where foo is the name of your version of UN*X as determined in part 1, until 113you have made the changes to config/os-type and/or config/arch. When the 114compilation is complete you will end up with a program called "A.arch_foo/amd". 115 116Try running: 117 118 A.arch_foo/amd -v 119 120and check the output. It should look something like: 121 122 Copyright (c) 1990 Jan-Simon Pendry 123 Copyright (c) 1990 Imperial College of Science, Technology & Medicine 124 Copyright (c) 1990 The Regents of the University of California. 125 amd 5.2.1.5 of 90/09/16 13:22:46 5.3Alpha5 #0: Sun Sep 16 13:23:28 BST 1990 126 Built by pendry@okeeffe.Berkeley.EDU for a tahoe running bsd44 (big-endian) 127 Map support for: root, passwd, nis, file, error. 128 fstypes: ufs, nfs, nfsx, host, link, program, auto, direct, toplvl, error. 129 130Make sure the O/S and architecture types were correctly derived during the 131build. 132 1335. ``Installation...'' 134 135If you are not just testing Amd, then you can install it by typing: 136 137 make install 138 139to install "A.arch_foo/amd" in "/usr/local/etc/amd" (or as otherwise 140modified in part 3). 141 1426. ``Update /etc/rpc'' 143 144Amq uses Sun RPC to talk to Amd using program number 300019 which has 145been registered with Sun. Add the following lines to /etc/rpc or your 146YP or Hesiod master: 147 148# Automount control protocol 149amd 300019 amq 150 151Amd does not require this addition - it just keeps rpcinfo happy. 152 1537. ``Hanging your machine...'' 154 155WARNING: THIS MAY HANG YOUR MACHINE IF YOU GET IT WRONG. 156 157Running Amd with a carelessly thought out mount map can cause your Amd to 158enter a deadlock inside the kernel. For example, attempting to automount a 159directory which is automounted. This will cause the automounter to issue a mount 160request causing the kernel to send an NFS request back to the same automounter, 161which is currently stuck in a system call and unable to respond - even 162kill -s KILL won't get you out of this one. 163 164There is nothing you can do to fix it without rebooting your machine, so... 165 166Find a diskless workstation and play with that first before trying this on 167your main 200 user service machine (unless you hate your users). Something 168like a diskless Sun-4 is best for development testing - you can compile on a 169Sun-4 server and run the binary on the diskless node. They reboot very fast 170as well between tests. 171 172Now you can try running Amd. Please read the documentation in doc/Amd.tex 173for more details. The configuration file "maps/a_master" provides a sample for 174you to play with. Something like: 175 176 ./amd -c 40 -D test,nodaemon /tmp/amnt ../maps/a_master & 177 178is good for testing. Note that Amd will clean up correctly if you send it a 179SIGINT or SIGTERM. Other signals are either ignored or will blow it away, 180leaving your machine in a potentially dangerous state. 181 182Remember that Amd needs to run as root in order to do mounts/unmounts 183though it does check this condition somewhere near line one of main(). 184It will also need write permission in the working directory if you 185have built it with DEBUG defined and your system's mount table is 186reflected in a file. In this case watch out for NFS stepping in and 187mapping root to nobody. 188 1898. ``Report what happened...'' 190 191If anything interesting happened, eg it didn't work, please report it to me 192-- Jan-Simon Pendry <jsp@doc.ic.ac.uk> -- as detailed in the README file. 193 194$Id: INSTALL,v 5.2.2.2 1992/05/31 16:49:22 jsp Exp $ 195