diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2007-12-05 15:48:03 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2007-12-05 15:48:03 +0000 |
commit | 16fdd0c0621aba945f531d35774fd6fb2502e53e (patch) | |
tree | 1339da9293125db04c1ce162ff377b70d0d5f09a /contrib/amd/scripts | |
parent | 04e1a1152fb3545ac6bbe0573f3cb0723a6f1f4a (diff) | |
parent | ad8bcc147f76709838923b5f73e352c06231e91f (diff) | |
download | src-16fdd0c0621aba945f531d35774fd6fb2502e53e.tar.gz src-16fdd0c0621aba945f531d35774fd6fb2502e53e.zip |
This commit was generated by cvs2svn to compensate for changes in r174294,
which included commits to RCS files with non-trunk default branches.
Notes
Notes:
svn path=/head/; revision=174295
Diffstat (limited to 'contrib/amd/scripts')
-rw-r--r-- | contrib/amd/scripts/am-eject.in | 2 | ||||
-rw-r--r-- | contrib/amd/scripts/amd.conf-sample | 115 | ||||
-rwxr-xr-x | contrib/amd/scripts/amd2ldif.in | 6 | ||||
-rwxr-xr-x | contrib/amd/scripts/amd2sun.in | 2 | ||||
-rw-r--r-- | contrib/amd/scripts/automount2amd.8 | 25 | ||||
-rwxr-xr-x | contrib/amd/scripts/automount2amd.in | 4 | ||||
-rwxr-xr-x | contrib/amd/scripts/ctl-amd.in | 32 | ||||
-rwxr-xr-x | contrib/amd/scripts/ctl-hlfsd.in | 14 | ||||
-rw-r--r-- | contrib/amd/scripts/expn.1 | 3 | ||||
-rwxr-xr-x | contrib/amd/scripts/expn.in | 2 | ||||
-rwxr-xr-x | contrib/amd/scripts/fix-amd-map.in | 2 | ||||
-rwxr-xr-x | contrib/amd/scripts/fixrmtab.in | 2 | ||||
-rwxr-xr-x | contrib/amd/scripts/redhat-ctl-amd.in | 4 | ||||
-rwxr-xr-x | contrib/amd/scripts/test-attrcache.in | 135 | ||||
-rwxr-xr-x | contrib/amd/scripts/wait4amd.in | 2 | ||||
-rwxr-xr-x | contrib/amd/scripts/wait4amd2die.in | 6 |
16 files changed, 287 insertions, 69 deletions
diff --git a/contrib/amd/scripts/am-eject.in b/contrib/amd/scripts/am-eject.in index 1f7f14d7b176..8754a3bd4751 100644 --- a/contrib/amd/scripts/am-eject.in +++ b/contrib/amd/scripts/am-eject.in @@ -2,7 +2,7 @@ # auto-unmount floppy/cd directory before ejecting device # script taken from Debian Linux's amd # -# Package: am-utils-6.0 +# Package: am-utils-6.x # (Additional) author: Erez Zadok <ezk@cs.columbia.edu> # set path diff --git a/contrib/amd/scripts/amd.conf-sample b/contrib/amd/scripts/amd.conf-sample index 02ccbdfc345b..880a74ba7552 100644 --- a/contrib/amd/scripts/amd.conf-sample +++ b/contrib/amd/scripts/amd.conf-sample @@ -1,17 +1,20 @@ -# -*- text -*- # A SAMPLE CONFIGURATION FILE FOR AMD ############################################################################## # GLOBAL OPTIONS SECTION (must be first in amd.conf file) +# For most options, the default value is listed first, but see amd.conf(5) [ global ] # (amd -n) -normalize_hostnames = yes | no +normalize_hostnames = no | yes +# do we want to strip domain names from hostnames or not? +domain_strip = yes | no # (amd -p) -print_pid = yes | no +print_pid = no | yes pid_file = /dev/stdout | /var/run/amd.pid # (amd -r) -restart_mounts = yes | no +restart_mounts = no | yes unmount_on_exit = no | yes +forced_unmounts = no | yes # (amd -a) auto_dir = /a # duration in seconds that a looked up name remain cached (amd -c) @@ -20,6 +23,7 @@ cache_duration = 300 local_domain = cs.columbia.edu # (amd -k) karch = sun4m +# (amd -A) arch = sun4 # if you don't like autoconf picking up "sunos5" as the os-type, override it # (amd -O) @@ -31,12 +35,28 @@ full_os = linux-2.2.5 # OS vendor vendor = redhat # if you print_version after setting up "os", it will show it. (amd -v) -print_version = yes | no +print_version = no | yes # (amd -l) -log_file = /var/log/amd | syslog | syslog:facility -# NFS (RPC/UDP) retry interval, in tenths of secs (amd -t interval.counter) +log_file = /dev/stderr | /var/log/amd | syslog[:facility] +# should we truncate the log file on startup? +truncate_log = no | yes +# NFS (RPC) retry interval/counter, in tenths of secs (amd -t interval.counter) nfs_retry_interval = 8 nfs_retransmit_counter = 11 (eleven retransmission attempts) +# The next four are the same as the above two, but allow you to set global +# values for all UDP vs. TCP mounts separately. +nfs_retry_interval_udp = 16 +nfs_retransmit_counter_udp = 22 +nfs_retry_interval_tcp = 4 +nfs_retransmit_counter_tcp = 5 +# These two are specific to Amd's top-level (NFSv2/udp) mounts +# and they can also be set separately. +nfs_retry_interval_toplvl = 6 +nfs_retransmit_counter_toplvl = 8 +# NFS attribute cache value for Amd's automount points +# (some OSs use this parameter in units of seconds, and others in 0.1 seconds) +# See README.attrcache for important information about this parameter. +auto_attrcache = 0 # (amd -w) dismount_interval = 120 # (amd -y) @@ -46,38 +66,60 @@ log_options = fatal,error,user,warn,info,map,stats,all # (amd -D) debug_options = all,amq,daemon,fork,full,hrtime,info,mem,mtab,\ str,readdir,test,trace,xdrtrace +# path for mtab file during mtab debug mode +debug_mtab_file = /tmp/mnttab # (amd -S) -plock = no | yes -# selectors are not recognized by default in the /defaults entry -selectors_in_defaults = yes | no +plock = yes | no # should browsable maps show number of entries to df/statfs (default=no) -show_statfs_entries = yes | no +show_statfs_entries = no | yes # (hpux) cluster name (amd -C) cluster = ??? # LDAP (Lightweight Directory Access Protocol) options ldap_base = "ou=Marketing, o=AMD Ltd, c=US" ldap_hostports = ldap.your.domain:389 -ldap_cache_seconds = 0 (default) -ldap_cache_maxmem = 131072 (default) +ldap_cache_seconds = 0 +ldap_cache_maxmem = 131072 +ldap_proto_version = 2 # default base name for hesiod maps hesiod_base = automount -# these 5 options can be overridden by each map individually -browsable_dirs = yes | no | full -map_options = cache:=all -map_type = file|hesiod|ndbm|nis|nisplus|passwd|union|ldap -# regular amd (nfs) mount point (default) -# don't try the "autofs" type. It is not implemented yet. -mount_type = nfs -search_path = /etc/local:/etc/amdmaps:/misc/yp +# interval to check if a reload of any maps is needed +map_reload_interval = 3600 # alternate RPC program number to register with the port mapper portmap_program = 300019-300029 +# Ask for a different Amq RPC port (both UDP and TCP). +# If set to 0 (default), Amd will pick a port automatically. +preferred_amq_port = 1234 # use fully qualified host names -fully_qualified_hosts = yes | no +fully_qualified_hosts = no | yes # force NFS version or NFS protocol nfs_vers = 2 | 3 nfs_proto = udp | tcp +# perform Amq service checks via tcpwrappers (tcpd/libwrap) +use_tcpwrappers = yes | no # allow NFS requests from insecure (>=1024) ports -nfs_allow_insecure_port = yes | no +nfs_allow_insecure_port = no | yes +# accept local NFS packets from any local interface, not just 127.0.0.1 +nfs_allow_any_interface = no | yes +# address used for local NFS mount and RPC server (default to localhost) +localhost_address = foo.example.com | 192.168.1.2 +# number of seconds to timeout before map returns output +exec_map_timeout = 10 +# normalize multiple/trailing slashes or not? +normalize_slashes = yes | no + +############################################################################## +# these 8 global options can be overridden by each map individually +browsable_dirs = no | yes | full +map_options = cache:=all +map_type = file|hesiod|ndbm|nis|nisplus|passwd|union|ldap +# any string that will be used to override to the map /defaults entry +map_defaults = opts:=nosuid,rw,intr,bg,noquota;type:=link +mount_type = nfs | autofs +autofs_use_lofs = yes | no +search_path = /etc/local:/etc/amdmaps:/misc/yp +# selectors are not recognized by default in the /defaults entry +selectors_in_defaults = no | yes +############################################################################## ############################################################################## # DEFINE AN AMD MOUNT POINT @@ -88,9 +130,8 @@ map_options = cache:=all # if map type is not defined, will search all map types (default) map_type = file|hesiod|ndbm|nis|nisplus|passwd|union|ldap search_path = /etc/local:/etc/amdmaps:/misc/yp -# regular amd (nfs) mount point (default) -# don't try the "autofs" type. It is not implemented yet. -mount_type = nfs +# an amd or autofs mount point +mount_type = nfs | autofs browsable_dirs = yes | no # an optional tag to be used with amd -T tag. untagged entries are always # used. Tagged ones get used only if specified with "amd -T" @@ -99,9 +140,25 @@ tag = test ############################################################################## # DEFINE ANOTHER AMD MOUNT POINT [ /src ] -map_name = /usr/local/lib/amdmaps/amu.src +map_name = /usr/local/lib/amdmaps/amu.src # regular amd (nfs) mount point (default) -# don't try the "autofs" type. It is not implemented yet. -mount_type = nfs +mount_type = nfs +# any string that will be used as prefix to the map /defaults entry +# this overrides what's defined in [global] +map_defaults = type:=nfs + +############################################################################## +# DEFINE ANOTHER AMD MOUNT POINT +[ /test ] +map_name = /etc/lookup-entry.sh +# an executable map type +map_type = exec + +############################################################################## +# DEFINE A SUN SYNTAX MOUNT POINT +[ /proj ] +map_name = /etc/amd.proj +# does this map use Sun Automounter map syntax? +sun_map_syntax = yes ############################################################################## diff --git a/contrib/amd/scripts/amd2ldif.in b/contrib/amd/scripts/amd2ldif.in index 6d3c28a9b3bf..34cee97cc1c2 100755 --- a/contrib/amd/scripts/amd2ldif.in +++ b/contrib/amd/scripts/amd2ldif.in @@ -18,10 +18,12 @@ my $mapname = $ARGV[0] or die $usage; my $base = $ARGV[1] or die $usage; $time = time(); -print "dn: cn=amdmap timestamp, $base\n"; -printf "$tfmt", "cn", "amdmap timestamp"; +print "dn: cn=amdmap $mapname timestamp, $base\n"; +printf "$tfmt", "cn", "amdmap $mapname timestamp"; printf "$tfmt", "objectClass", "amdmapTimestamp"; +printf "$tfmt", "amdmapName", "$mapname"; printf "$tfmt", "amdmapTimestamp", $time; +printf "$tfmt", "amdmapName", $mapname; print "\n"; my $line = ""; diff --git a/contrib/amd/scripts/amd2sun.in b/contrib/amd/scripts/amd2sun.in index df69b09739cd..7616c83b915c 100755 --- a/contrib/amd/scripts/amd2sun.in +++ b/contrib/amd/scripts/amd2sun.in @@ -2,7 +2,7 @@ # convert amd maps to Sun automount maps # usage: amd2sun file # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: "Mark D. Baushke" <mdb@cisco.com> print "# file created by amd2sun diff --git a/contrib/amd/scripts/automount2amd.8 b/contrib/amd/scripts/automount2amd.8 index e4fa9bcde2fe..bd3b61230ab6 100644 --- a/contrib/amd/scripts/automount2amd.8 +++ b/contrib/amd/scripts/automount2amd.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1997-2004 Erez Zadok +.\" Copyright (c) 1997-2006 Erez Zadok .\" Copyright (c) 1990 Jan-Simon Pendry .\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine .\" Copyright (c) 1990 The Regents of the University of California. @@ -38,7 +38,7 @@ .\" .\" %W% (Berkeley) %G% .\" -.\" $Id: automount2amd.8,v 1.2.2.4 2004/01/06 03:15:25 ezk Exp $ +.\" $Id: automount2amd.8,v 1.8.2.1 2006/01/02 18:48:26 ezk Exp $ .\" .TH AUTOMOUNT2AMD 8L "24 May 1993" .SH NAME @@ -100,7 +100,22 @@ moon \ does not understand newer Sun Automount map syntax, those used by autofs. .SH "SEE ALSO" .BR conv2amd (8), amd (8). +.LP +``am-utils'' +.BR info (1) +entry. +.LP +.I "Linux NFS and Automounter Administration" +by Erez Zadok, ISBN 0-7821-2739-8, (Sybex, 2001). +.LP +.I http://www.am-utils.org +.LP +.I "Amd \- The 4.4 BSD Automounter" .SH AUTHORS -Original author Mike Walker <mike@tab00.larc.nasa.gov>. Script modified by -Erez Zadok <ezk@cs.columbia.edu>, Department of Computer Science, Columbia -University, New York, USA. +Original author Mike Walker <mike@tab00.larc.nasa.gov>. +Script modified by Erez Zadok <ezk@cs.sunysb.edu>, Computer Science +Department, Stony Brook University, Stony Brook, New York, USA. +.P +Other authors and contributors to am-utils are listed in the +.B AUTHORS +file distributed with am-utils. diff --git a/contrib/amd/scripts/automount2amd.in b/contrib/amd/scripts/automount2amd.in index e99c74b8dd9a..79a7b770d556 100755 --- a/contrib/amd/scripts/automount2amd.in +++ b/contrib/amd/scripts/automount2amd.in @@ -2,7 +2,7 @@ # # Convert Sun automount map format to amd format # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Mike Walker <mike@tab00.larc.nasa.gov> # Erez Zadok <ezk@cs.columbia.edu> # @@ -26,7 +26,7 @@ # # You should set the DOMAIN and DEFAULT variables to your preferences. # -# $Id: automount2amd.in,v 1.1 1999/08/16 01:16:36 ezk Exp $ +# $Id: automount2amd.in,v 1.2 2002/01/15 18:25:25 ezk Exp $ # require "ctime.pl"; diff --git a/contrib/amd/scripts/ctl-amd.in b/contrib/amd/scripts/ctl-amd.in index ffd696d80144..694b31a9764c 100755 --- a/contrib/amd/scripts/ctl-amd.in +++ b/contrib/amd/scripts/ctl-amd.in @@ -2,12 +2,12 @@ # control starting, stopping, or restarting amd. # usage: ctl-amd [start|stop|status|restart|condrestart|reload] # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Erez Zadok <ezk@cs.columbia.edu> # # chkconfig: - 72 28 # description: Runs the automount daemon that mounts devices and NFS hosts \ -# on demand. +# on demand. # processname: amd # config: /etc/amd.conf # @@ -60,16 +60,20 @@ fi return 1 } +# before running any real programs, chdir to / to avoid possible hangs on +# (NFS) mounts which may be restarting. +cd / + # search for amd.conf file -CF_FILE="${prefix}/etc/amd.conf" +CF_FILE="@sysconfdir@/amd.conf" # any local copy of the conf file overrides the "global" one if [ -f /etc/amd.conf ] then CF_FILE="/etc/amd.conf" fi -if [ -f ${prefix}/etc/amd.conf ] +if [ -f @sysconfdir@/amd.conf ] then - CF_FILE="${prefix}/etc/amd.conf" + CF_FILE="@sysconfdir@/amd.conf" fi if [ -f /etc/local/amd.conf ] then @@ -99,7 +103,7 @@ case "$1" in echo "killing amd..." killproc " amd" wait4amd2die - test -f /var/lock/subsys/amd && rm -f /var/lock/subsys/amd + rm -f /var/lock/subsys/amd ;; 'restart') @@ -117,14 +121,14 @@ case "$1" in 'condrestart') if [ -f /var/lock/subsys/amd ]; then - ctl-amd stop - ctl-amd start - fi + ctl-amd stop + ctl-amd start + fi ;; 'reload') - amq -f - ;; + amq -f + ;; 'status') # run amq -v to produce status @@ -139,13 +143,13 @@ case "$1" in # start_msg and stop_msg are for HPUX 'start_msg') - echo "Start am-utils 6.0 automounter" + echo "Start am-utils 6.1 automounter" ;; 'stop_msg') - echo "Stop am-utils 6.0 automounter" + echo "Stop am-utils 6.1 automounter" ;; *) - echo "Usage: @sbindir@/ctl-amd [start|stop|status|restart|condrestart|reload]" + echo "Usage: $0 [start|stop|status|restart|condrestart|reload]" ;; esac diff --git a/contrib/amd/scripts/ctl-hlfsd.in b/contrib/amd/scripts/ctl-hlfsd.in index 9642e2de8558..ee0dd27ca15a 100755 --- a/contrib/amd/scripts/ctl-hlfsd.in +++ b/contrib/amd/scripts/ctl-hlfsd.in @@ -2,7 +2,7 @@ # control starting, stopping, or restarting hlfsd. # usage: ctl-hlfsd [start | stop | restart] # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Erez Zadok <ezk@cs.columbia.edu> # # chkconfig: - 72 28 @@ -51,6 +51,10 @@ fi return 1 } +# before running any real programs, chdir to / to avoid possible hangs on (NFS) +# mounts. +cd / + # locate logs directory if [ -d /var/log ]; then logdir="/var/log" @@ -71,8 +75,8 @@ else fi # locate any optional password file -if [ -f ${prefix}/etc/passwd ]; then - PASSWD_FILE="-P ${prefix}/etc/passwd" +if [ -f @sysconfdir@/passwd ]; then + PASSWD_FILE="-P @sysconfdir@/passwd" else PASSWD_FILE="" fi @@ -84,8 +88,8 @@ case "$1" in # if [ -x @sbindir@/hlfsd -a -h $maildir ] then - echo @sbindir@/hlfsd ${PASSWD_FILE} -a $altmaildir -x all -D fork -l $logdir/hlfsd /mail/home .mailspool - @sbindir@/hlfsd ${PASSWD_FILE} -a $altmaildir -x all -D fork -l $logdir/hlfsd /mail/home .mailspool & + echo @sbindir@/hlfsd ${PASSWD_FILE} -a $altmaildir -x all -l $logdir/hlfsd /mail/home .mailspool + @sbindir@/hlfsd ${PASSWD_FILE} -a $altmaildir -x all -l $logdir/hlfsd /mail/home .mailspool & test -x /var/lock/subsys && touch /var/lock/subsys/hlfsd fi ;; diff --git a/contrib/amd/scripts/expn.1 b/contrib/amd/scripts/expn.1 index bb90c49ab705..f316247b4a9c 100644 --- a/contrib/amd/scripts/expn.1 +++ b/contrib/amd/scripts/expn.1 @@ -16,7 +16,7 @@ $sockaddr = 'S n a4 x8'; # system requirements: # must have 'nslookup' and 'hostname' programs. -# $Header: /home/cvsroot/am-utils/scripts/expn.1,v 1.1.1.1.2.3 2004/01/06 03:15:25 ezk Exp $ +# $Header: /home/cvsroot/am-utils/scripts/expn.1,v 1.4 2003/07/18 15:17:37 ezk Exp $ # TODO: # less magic should apply to command-line addresses @@ -1318,7 +1318,6 @@ it is possible to eliminate bugs. .SH ENVIRONMENT No environment variables are used. .SH FILES -.PD 0 .B /tmp/expn$$ .B temporary file used as input to .BR nslookup . diff --git a/contrib/amd/scripts/expn.in b/contrib/amd/scripts/expn.in index 7dbee4191214..9ae575729366 100755 --- a/contrib/amd/scripts/expn.in +++ b/contrib/amd/scripts/expn.in @@ -15,7 +15,7 @@ $SOCK_STREAM = &SOCK_STREAM; # system requirements: # must have 'nslookup' and 'hostname' programs. -# $Header: /home/cvsroot/am-utils/scripts/expn.in,v 1.2.2.2 2002/07/11 14:27:02 ezk Exp $ +# $Header: /home/cvsroot/am-utils/scripts/expn.in,v 1.5 2002/07/11 14:28:20 ezk Exp $ # TODO: # less magic should apply to command-line addresses diff --git a/contrib/amd/scripts/fix-amd-map.in b/contrib/amd/scripts/fix-amd-map.in index 6746462daa77..9bbc9b6a21bc 100755 --- a/contrib/amd/scripts/fix-amd-map.in +++ b/contrib/amd/scripts/fix-amd-map.in @@ -5,7 +5,7 @@ # takes any number of files on the command line, and produces # a fixed map on stdout. # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Erez Zadok <ezk@cs.columbia.edu> # diff --git a/contrib/amd/scripts/fixrmtab.in b/contrib/amd/scripts/fixrmtab.in index 33b7bcfdb6ce..23003806e4c0 100755 --- a/contrib/amd/scripts/fixrmtab.in +++ b/contrib/amd/scripts/fixrmtab.in @@ -5,7 +5,7 @@ # # usage: fixrmtab host1 host2 ... # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Andreas Stolcke <stolcke@icsi.berkeley.edu> #set -x diff --git a/contrib/amd/scripts/redhat-ctl-amd.in b/contrib/amd/scripts/redhat-ctl-amd.in index 4143cdda2421..4d00d472c24a 100755 --- a/contrib/amd/scripts/redhat-ctl-amd.in +++ b/contrib/amd/scripts/redhat-ctl-amd.in @@ -23,7 +23,9 @@ fi RETVAL=0 prog=amd -amd=@prefix@/sbin/amd +prefix=@prefix@ +exec_prefix=@exec_prefix@ +amd=@sbindir@/amd start() { echo -n "Starting $prog: " diff --git a/contrib/amd/scripts/test-attrcache.in b/contrib/amd/scripts/test-attrcache.in new file mode 100755 index 000000000000..061308b42dbe --- /dev/null +++ b/contrib/amd/scripts/test-attrcache.in @@ -0,0 +1,135 @@ +#!/bin/sh +# Script to test the attribute cache behavior of the local OS client. +# If this script fails, it means that Amd cannot turn off the attrcache +# reliably on this host, and Amd therefore may not run reliably. See +# the README.attrcache file distributed with this am-utils. +# -Erez Zadok, September 29, 2005 + +# set PATH (must install am-utils first) +prefix=@prefix@ +exec_prefix=@exec_prefix@ +PATH=@sbindir@:@bindir@:/usr/ucb:/usr/bin:/bin:${PATH} +export PATH + +# test if amd is running +amq -p > /dev/null 2>&1 +if test $? = 0 +then + echo "### Amd already running... please shutdown Amd first" + exit 1 +fi + +mapfile="/tmp/amd.testmap.$$" +logfile="/var/log/amd" +delay=1 +a=/a + +CreateMap1 () { + echo "### Creating correct map" + cat - >$mapfile <<EOF +a type:=link;fs:=/tmp/a +EOF +} + +CreateMap2 () { + echo "### Creating weird map" + cat - >$mapfile <<EOF +a type:=link;fs:=/tmp/b +EOF +} + +StopAMD () { + ctl-amd stop +# do not delete files we may need to use to debug Amd +# rm -f /tmp/a /tmp/b $mapfile $logfile +} + +touch /tmp/a +touch /tmp/b + +CreateMap1 +echo amd -x all -D all -r -l $logfile $a $mapfile -cache:=mapdefault,sync +amd -x all -D all -r -l $logfile $a $mapfile -cache:=mapdefault,sync +sleep 3 # give amd chance to start properly +amq +inode_a=`ls -lLi /tmp/a | awk '{print $1}'` +inode_b=`ls -lLi /tmp/b | awk '{print $1}'` +ls -lLi $a/a +ls -lLi $a/b +ls -l $mapfile + +# how many times to try until we call it a success... +maxtry=10 +while test $maxtry -gt 0 +do + echo "$maxtry tries left ..." + let maxtry=maxtry-1 + amq + CreateMap1 + sleep $delay + + ls -l $mapfile + echo "### looking at a... should get a" + ino=`ls -lLi $a/a | awk '{print $1}'` + if test -z "$ino" + then + ls -li $a/a + amq + amq -m + stat $a + echo "a link does not exist!" + StopAMD + exit 1 + fi + if test $ino -ne $inode_a + then + ls -li $a/a + amq + amq -m + stat $a + echo "a link does not point to A!" + StopAMD + exit 1 + fi + +# Here is the main trick we try: force amd to flush one entry, then +# change the amd map on disk, and then see if the kernel will have +# flushed the attribute cache; if it did, then Amd will see the +# correctly changed map entry. + + amq -u $a/a + sleep $delay + stat $a + + CreateMap2 + sleep $delay + + ls -l $mapfile + echo "### looking at a... should get b" + ino=`ls -lLi $a/a | awk '{print $1}'` + if test -z "$ino" + then + ls -li $a/a + amq + amq -m + stat $a + echo "a link does not exist!" + StopAMD + exit 1 + fi + if test $ino -ne $inode_b + then + ls -li $a/a + amq + amq -m + stat $a + echo "a link does not point to B!" + StopAMD + exit 1 + fi + + amq -u $a/a + sleep $delay + stat $a +done +StopAMD diff --git a/contrib/amd/scripts/wait4amd.in b/contrib/amd/scripts/wait4amd.in index 5fd503075672..5e6c33a579c4 100755 --- a/contrib/amd/scripts/wait4amd.in +++ b/contrib/amd/scripts/wait4amd.in @@ -3,7 +3,7 @@ # usage: wait4amd <hostname> [<command> [args ...]] # If only hostname is supplied, command defaults to rsh $hostname # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Erez Zadok <ezk@cs.columbia.edu> #set -x diff --git a/contrib/amd/scripts/wait4amd2die.in b/contrib/amd/scripts/wait4amd2die.in index d3541e78672c..94a08513f889 100755 --- a/contrib/amd/scripts/wait4amd2die.in +++ b/contrib/amd/scripts/wait4amd2die.in @@ -4,7 +4,7 @@ # If not specified, delay=5 seconds and count=6 (total 30 seconds) # If at end of total delay amd is till up, return 1; else return 0. # -# Package: am-utils-6.0 +# Package: am-utils-6.x # Author: Erez Zadok <ezk@cs.columbia.edu> #set -x @@ -20,14 +20,14 @@ if test -n "$1" then delay=$1 else - delay=5 + delay=3 fi # how many times to delay if test -n "$2" then count=$2 else - count=6 + count=10 fi i=1 |