From owner-freebsd-hackers Mon Feb 13 13:16:16 1995 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id NAA26995 for hackers-outgoing; Mon, 13 Feb 1995 13:16:16 -0800 Received: from tfs.com (mailhub.tfs.com [140.145.250.1]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id NAA26989; Mon, 13 Feb 1995 13:16:13 -0800 Received: by tfs.com (smail3.1.28.1) Message-Id: From: julian@tfs.com (Julian Elischer) Subject: Re: any amd users out there? To: jkh@FreeBSD.org (Jordan K. Hubbard) Date: Mon, 13 Feb 1995 13:15:40 -0800 (PST) Cc: hackers@FreeBSD.org In-Reply-To: <199502131436.GAA15124@time.cdrom.com> from "Jordan K. Hubbard" at Feb 13, 95 06:36:44 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 2622 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > Can to send me your maps? I've read the docs and I'm still > confused! :-) > > Basically, I just want to map machines into a /machine/path > scheme. /thud/d, /freefall/a, etc. > > Thanks! > > Jordan > to start it off, add in /etc/rc something of the form..... #---------------------------- PATH=/sbin:/usr/sbin:/usr/bin export PATH #LOGFILE=syslog LOGFILE=/var/adm/syslog/amd.log MAP_1="/net /etc/a_net" MAP_2="" MAP_3="" MAP_4="" TMOUT="-w 300" case "$LOGFILE" in */*) if [ -f "$LOGFILE" ]; then mv "$LOGFILE" "$LOGFILE"- fi > "$LOGFILE" ;; syslog) : ;; esac if [ -x /usr/sbin/amd -a -r /etc/a_net ]; then if (/usr/sbin/amd -p -r -a /tmp_mnt -l $LOGFILE $TMOUT $MAP_1 $MAP_2 $MAP_3 $MAP_4) > /var/run/amd.pid ; then echo "NFS auto-mount service started" else echo "Unable to provide NFS auto-mount service" fi fi #----------------------- and in /etc/a_net, put: #-------------------- /defaults type:=host;fs=${autodir}/${rhost}/root;rhost:=${key} * opts:=rw,nosuid,grpid #-------------------- what this does is mounts amd on /net, with a map described in /etc/a_net. whenever you do a lookup() operation on /net, amd (pretending to be an NFS server) gets the make being looked for, and uses the algorythm described in a_net to decide what to do with that name.. it will return as though it found a symbolic link, pointing to wherever it decided you should look. If the system you want to look at hasn't previously been mounted, it will quickly mount it's exported filesystems in /tmp_mnt, and return the appropriate symbolic link, so that further name lookup (and eventually open()) operations occur over there, on the appropriate filesystem. to read the a_net file.. read it as: /defaults type:=host;fs=${autodir}/${rhost}/root;rhost:=${key} "for all operations the following operations and flags apply...." notice that the variable ${key}, and ${rhost} will be evaluated at the time of the lookup request, not at initialisation time. * opts:=rw,nosuid,grpid "for any name being looked up that matches '*' (that's all of them folks), apply the following flags, (and of course the defaults defined above)" in the case above ${autodir} is set to /tmp_mnt thus /net/freefall/usr would be mapped to: /tmp_mnt/freefall/root/usr which will have been mounted for you bby amd, as soon as it realised that you were going to need it.. I don't think the 'root' field is needed in a_net, but it was in the example given in the docs so I left it.