Date: Mon, 13 Feb 1995 13:15:40 -0800 (PST) From: julian@tfs.com (Julian Elischer) To: jkh@FreeBSD.org (Jordan K. Hubbard) Cc: hackers@FreeBSD.org Subject: Re: any amd users out there? Message-ID: <m0re87Q-0003wNC@TFS.COM> In-Reply-To: <199502131436.GAA15124@time.cdrom.com> from "Jordan K. Hubbard" at Feb 13, 95 06:36:44 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0re87Q-0003wNC>