I know that handing out this sort of information might compromise
one's system. All I can say is I promise not to use the information
for any other purpose than to learn amd map file tricks. flames, etc,
to /dev/null.
--
J. Eric Townsend - j...@uh.edu - Systems Wrangler, UH Dept of Mathematics
Note! New vox number: (713) 743-3466 '91 CB750, DoD# 0378
Wanted: copy of Max Headroom episode "Baby Grow Bags".
email/phone me if you have any leads on where I can find a copy.
>I've been using amd for a few months now, but haven't dared trying
>anything too cool. I just use simple direct mounts and drive on.
>Now, I'm looking for some examples of really tricky things done with
>amd.
How about a "canonical" depot map?
It works together with the enclosed patches, written by Rodney
Peck, of RPI, and me.
It lets you do hierarchical mounts based on architecture. The maps
practically never require maintenance, and allow any host to
interchangeably perform the role of server and client, in a cooperative
way with other hosts.
Limitation: you cannot point the symbolic link filesystem, as I have
patched it, to another automount map.
Brian
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. The tool that generated this
# shell archive is called "shar", and is available by anonymous ftp
# from uunet.uu.net in subdirectory comp.sources.unix. If this archive
# is complete, you will see the following message at the end:
# "End of shell archive."
# Contents: Makefile amd.depot amd.misc amd.net amd.start amq-v
# mapc.c.patch sfs_ops.c.patch
# Wrapped by fit...@mml0.meche.rpi.edu on Thu Jun 4 20:10:46 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(1930 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# This makefile is included by the yellow pages Makefile in order to
X# distribute these system automount tables in yellow pages data bases.
X# The yp makefile needs to have an 'include' of this file and the
X# target 'autotabs' added to its target 'all' in order for this to
X# work. klm 6-Jan-1990
X
X# In order to add a table as a yp map:
X#
X# - add it as a dependency of the 'all' target;
X# - add a target for it just like the others in the "Specific targets" section.
X#
X# The generic recipe below will then be invoked to do the right thing.
X#
X# Please be sure that a suitable map doesn't already exist before
X# instituting a new one. Also note that entirely new YP will not
X# successfully push to slave servers - you have to login to the slave
X# and do a /usr/etc/yp/ypxfr -h <master host> <new map name> in order
X# to institute the new map.
X
X
XDATABASES= \
X amd.net amd.depot amd.misc
X
X# amd.home amd.image amd.net amd.import
X
X.PRECIOUS: $(DATABASES)
X
X# Depot automount tables directory:
XATABDIR=/etc/amdmap
X
XNOPUSH=""
XYPDIR=/usr/etc/yp
XYPDBDIR=/var/yp
XDOM=`domainname`
XMAKEDBM=$(YPDIR)/makedbm -b
XYPPUSH=$(YPDIR)/yppush # -v
X
Xall: $(DATABASES)
X
X# Specific targets:
Xamd.home: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.import: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.depot: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.misc: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.image: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.net: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.man: force
X -@$(MAKE) TARGET=$@ $@.time
Xamd.usenet: force
X -@$(MAKE) TARGET=$@ $@.time
Xforce: ;
X
X# Generic recipe:
X$(TARGET).time: $(ATABDIR)/$(TARGET)
X -@if [ -f $? ]; then \
X echo -n "$(TARGET) ... "; \
X grep -v "^#" $? | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/$(TARGET); \
X touch $@ ; \
X echo "updated"; \
X if [ ! $(NOPUSH) ]; then \
X $(YPPUSH) $(TARGET); \
X echo "pushed $(TARGET)"; \
X else \
X echo "nopush..." ; \
X fi \
X else \
X echo "couldn't find $? "; \
X fi
END_OF_FILE
if test 1930 -ne `wc -c <'Makefile'`; then
echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'amd.depot' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'amd.depot'\"
else
echo shar: Extracting \"'amd.depot'\" \(915 characters\)
sed "s/^X//" >'amd.depot' <<'END_OF_FILE'
X# amd.depot
X#
X# depot software
X#
X# 4.4 BSD automounter daemon map
X#
X
X/defaults opts:=intr,noquota
X
X* type:=auto;fs:=${map};pref:=${key}/
X
X*/arch type:=link;fs:=/export/depot/${key/};sublink:=${archdir} \
X -type:=nfs;rfs:=/export/depot/${key/};sublink:=${archdir} \
X rhost:=h.meche.rpi.edu \
X rhost:=r.meche.rpi.edu \
X rhost:=m.meche.rpi.edu \
X rhost:=s.ipl.rpi.edu
X
X*/* type:=link;fs:=/export/depot/${key/};sublink:=${/key} \
X -type:=nfs;rfs:=/export/depot/${key/};sublink:=${/key} \
X rhost:=h.meche.rpi.edu \
X rhost:=r.meche.rpi.edu \
X rhost:=m.meche.rpi.edu \
X rhost:=s.ipl.rpi.edu
X
X*/Top type:=link;fs:=/export/depot/${key/} \
X -type:=nfs;rfs:=/export/depot/${key/} \
X rhost:=h.meche.rpi.edu \
X rhost:=r.meche.rpi.edu \
X rhost:=m.meche.rpi.edu \
X rhost:=s.ipl.rpi.edu
X
X# depot servers
XServer/* host==${/key};type:=link;fs:=/export/depot \
X host!=${/key};type:=nfs;rfs:=/export/depot;rhost:=${/key}
END_OF_FILE
if test 915 -ne `wc -c <'amd.depot'`; then
echo shar: \"'amd.depot'\" unpacked with wrong size!
fi
# end of 'amd.depot'
fi
if test -f 'amd.misc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'amd.misc'\"
else
echo shar: Extracting \"'amd.misc'\" \(445 characters\)
sed "s/^X//" >'amd.misc' <<'END_OF_FILE'
X# amd.misc
X#
X# 4.4 BSD automounter daemon map
X#
X/defaults opts:=ro,intr,noquota
X
Xman -type:=nfs;rfs:=/usr/share/man \
X rhost:=h.meche.rpi.edu \
X rhost:=s.ipl.rpi.edu
X
Xusenet -type:=nfsx;rfs:=/usenet,/,/spool \
X rhost:=usenet.rpi.edu
X
Xafs -type:=nfs;rfs:=/afs \
X rhost:=r.meche.rpi.edu \
X rhost:=s.ecse.rpi.edu
X
Xsys -type:=nfs;rfs:=/usr/share/sys \
X rhost:=h.meche.rpi.edu
X
Xh -opts:=rw,intr,noquota;type:=nfs;rfs:=/f1/h \
X rhost:=r.meche.rpi.edu
END_OF_FILE
if test 445 -ne `wc -c <'amd.misc'`; then
echo shar: \"'amd.misc'\" unpacked with wrong size!
fi
# end of 'amd.misc'
fi
if test -f 'amd.net' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'amd.net'\"
else
echo shar: Extracting \"'amd.net'\" \(154 characters\)
sed "s/^X//" >'amd.net' <<'END_OF_FILE'
X# amd.net
X#
X# network hosts map
X#
X# 4.4 BSD automounter daemon map
X#
X/defaults type:=host;fs:=${autodir}/${rhost}/root;rhost:=${key}
X* opts:=intr,noquota
END_OF_FILE
if test 154 -ne `wc -c <'amd.net'`; then
echo shar: \"'amd.net'\" unpacked with wrong size!
fi
# end of 'amd.net'
fi
if test -f 'amd.start' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'amd.start'\"
else
echo shar: Extracting \"'amd.start'\" \(2348 characters\)
sed "s/^X//" >'amd.start' <<'END_OF_FILE'
X#!/bin/sh -
X#
X# Start amd
X#
X# $Id: amd.start.ex,v 5.1 89/11/17 18:23:57 jsp Exp Locker: jsp $
X#
X# Copyright (c) 1989 Jan-Simon Pendry
X# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
X# Copyright (c) 1989 The Regents of the University of California.
X# All rights reserved.
X#
X# This code is derived from software contributed to Berkeley by
X# Jan-Simon Pendry at Imperial College, London.
X#
X# Redistribution and use in source and binary forms are permitted
X# provided that the above copyright notice and this paragraph are
X# duplicated in all such forms and that any documentation,
X# advertising materials, and other materials related to such
X# distribution and use acknowledge that the software was developed
X# by Imperial College of Science, Technology and Medicine, London, UK.
X# The names of the College and University may not be used to endorse
X# or promote products derived from this software without specific
X# prior written permission.
X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X#
X# %W% (Berkeley) %G%
X#
XPATH=/usr/local/etc:/bin:/usr/bin:/usr/ucb:$PATH export PATH
X
X#
X# Either name of logfile or "syslog"
X#
X#LOGFILE=syslog
XLOGFILE=/var/adm/am.log
X
X#
X# Figure out whether domain name is in host name
X# If the hostname is just the machine name then
X# pass in the name of the local domain so that the
X# hostnames in the map are domain stripped correctly.
X#
Xcase `hostname` in
X*.*) dmn= ;;
X*) dmn='-d meche.rpi.edu'
Xesac
X
X#
X# Zap earlier log file
X#
Xcase "$LOGFILE" in
X*/*)
X mv "$LOGFILE" "$LOGFILE"-
X > "$LOGFILE"
X ;;
Xsyslog)
X : nothing
X ;;
Xesac
X
Xrelease=`uname -r` export release
Xcase $release in
X 4.1.1)
X reldir=41 ;;
X 4.0.3)
X reldir=403 ;;
X *)
X reldir=4 ;;
Xesac
X
Xexport reldir
Xostype=os$reldir export ostype
Xarchtype=`arch`-$ostype export archtype
Xarchdir=arch.$archtype export archdir
X
X#
X# -r restart
X# -d dmn local domain
X# -w wait wait between unmount attempts
X# -l log logfile or "syslog"
X# -x opts specifies the type and verbosity of log messages
Xx="-x noinfo"
X
Xeval nice --4 amd -p > /etc/amd.pid -r $dmn -w 240 -l "$LOGFILE" $x \
X /a_mnt amd.misc -cache:=inc \
X /depot amd.depot -cache:=inc \
X /n amd.net -cache:=inc
END_OF_FILE
if test 2348 -ne `wc -c <'amd.start'`; then
echo shar: \"'amd.start'\" unpacked with wrong size!
fi
chmod +x 'amd.start'
# end of 'amd.start'
fi
if test -f 'amq-v' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'amq-v'\"
else
echo shar: Extracting \"'amq-v'\" \(137 characters\)
sed "s/^X//" >'amq-v' <<'END_OF_FILE'
Xamd 5.2.1.13 of 91/05/07 22:32:38 5.3bsdnet #9: Sun Nov 3 17:02:56 EST 1991
XBuilt by fi...@hammer.meche.rpi.edu for a sun3 running sos4.
END_OF_FILE
if test 137 -ne `wc -c <'amq-v'`; then
echo shar: \"'amq-v'\" unpacked with wrong size!
fi
# end of 'amq-v'
fi
if test -f 'mapc.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mapc.c.patch'\"
else
echo shar: Extracting \"'mapc.c.patch'\" \(1056 characters\)
sed "s/^X//" >'mapc.c.patch' <<'END_OF_FILE'
X*** mapc.c.orig Thu Jun 4 19:47:55 1992
X--- mapc.c Thu Jun 4 19:47:55 1992
X***************
X*** 711,716 ****
X--- 711,745 ----
X if (error)
X *subp = 0;
X }
X+
X+ /*
X+ * try using just the last part of the key prepended
X+ * with "* /"
X+ * For example:
X+ * "src/gnu/gcc" -> "* /gcc"
X+ * or a better example:
X+ * "X/arch" -> "* /arch"
X+ */
X+ if (error && (subp = strrchr(key, '/'))) {
X+ strcpy(wildname, "*");
X+ strcat(wildname, subp);
X+ #ifdef DEBUG
X+ dlog("mapc recurses on %s", wildname);
X+ #endif
X+ error =
X+ mapc_meta_search(m, wildname, pval, MREC_PART);
X+ }
X+
X+ /* try to match a directory like * / * */
X+ if (error && (subp = strrchr(key,'/'))) {
X+ strcpy (wildname, "*/*");
X+ #ifdef DEBUG
X+ dlog("mapc recurses on %s", wildname);
X+ #endif
X+ error =
X+ mapc_meta_search(m, wildname, pval, MREC_PART);
X+ }
X+
X if (error > 0 && m->wildcard) {
X *pval = strdup(m->wildcard);
X error = 0;
END_OF_FILE
if test 1056 -ne `wc -c <'mapc.c.patch'`; then
echo shar: \"'mapc.c.patch'\" unpacked with wrong size!
fi
# end of 'mapc.c.patch'
fi
if test -f 'sfs_ops.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'sfs_ops.c.patch'\"
else
echo shar: Extracting \"'sfs_ops.c.patch'\" \(695 characters\)
sed "s/^X//" >'sfs_ops.c.patch' <<'END_OF_FILE'
X*** sfs_ops.c.orig Thu Jun 4 19:48:07 1992
X--- sfs_ops.c Thu Jun 4 19:48:07 1992
X***************
X*** 45,50 ****
X--- 45,51 ----
X
X #ifdef HAS_SFS
X
X+ #include <sys/stat.h>
X /*
X * Symbol-link file system
X */
X***************
X*** 96,110 ****
X return strdup(fo->opt_fs);
X }
X
X- /*ARGUSED*/
X static int sfs_fmount(mf)
X mntfs *mf;
X {
X! /*
X! * Wow - this is hard to implement!
X! */
X
X! return 0;
X }
X
X /*ARGUSED*/
X--- 97,111 ----
X return strdup(fo->opt_fs);
X }
X
X static int sfs_fmount(mf)
X mntfs *mf;
X {
X! struct stat stb;
X! char *cp;
X
X! cp = mf->mf_mount;
X! if ( *cp == '.' && *(cp + 1) == '/' ) cp++;
X! return stat(cp,&stb) ? errno : 0 ;
X }
X
X /*ARGUSED*/
END_OF_FILE
if test 695 -ne `wc -c <'sfs_ops.c.patch'`; then
echo shar: \"'sfs_ops.c.patch'\" unpacked with wrong size!
fi
# end of 'sfs_ops.c.patch'
fi
echo shar: End of shell archive.
exit 0