*BSD News Article 24289


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!ogicse!cs.uoregon.edu!usenet.ee.pdx.edu!not-for-mail
From: eric@ee.pdx.edu (Eric Berggren)
Newsgroups: comp.unix.bsd
Subject: AMD question: ${rhost} expansion and ...
Message-ID: <2cote8$r5q@ursula.ee.pdx.edu>
Date: 21 Nov 93 07:26:00 GMT
Article-I.D.: ursula.2cote8$r5q
Sender: eric@ursula.ee.pdx.edu
Lines: 67
NNTP-Posting-Host: ee.pdx.edu
X-Newsreader: NN version 6.5.0 #2 (NOV)


  I am investigating the prospect of upgrading automount on our Sun
network to AMD. With the exception of /, /usr (and maybe /var and /tmp),
all hosts have their local disks mounted at boot under /disk/<name-of-part>
(ie, the filesystems do not reflect the source and may not be unique).
This was so that we didn't have to maintain two maps for autmount (one
for NFS, one for local). It has other advantages over /home/host/<name> .
Users may be accessed indirectly via /u/<username> where the actual
filesystem may be on any host (including locally).

  Anyway, with that in mind, I'm trying to set up AMD to provide the
same functionality as automount for starters. I am attempting to use
the following map to accomplish this :

= /defaults	sublink:=${key};hostd!=${rhost};type:=nfs \
= 				hostd==${rhost};type:=link;fs:=${rfs}
= 
= eric		rhost:=ren.cs.pdx.edu;rfs:=/disk/blort
= jane		rhost:=ren.cs.pdx.edu;rfs:=/disk/blort
= sue		rhost:=ren.cs.pdx.edu;rfs:=/disk/blort
= bob		rhost:=ren.cs.pdx.edu;rfs:=/disk/blort
= zort		rhost:=ren.cs.pdx.edu;rfs:=/disk/blort

  If the user is on a host other than "ren", it will mount the filesystem
ren:/disk/blort (if not already) and make the sublink. Otherwise, it will
simply make a link into /disk/blort (already mounted in fstab).

  Two problems arrise from this. First, ${rhosts} does not appear to
get expanded at the appropriate time before comparison. The manual
states that ${rhost} is expanded first, assignments next, selectors
and options last. I am finding that hostd==${rhost} always fails
on "ren" (I have also tried 'host==${rhost.}' etc.). host==ren and
hostd=ren.cs.pdx.edu do succeed however. Where am I blundering here ?

  Second, AMD seems to get confused with the non-determinism of the
/defaults line. Replacing ${rhost} with "ren.cs.pdx.edu" to get
around problem #1 temporarily, the above works fine on remote hosts,
however, it fails on ren, with the entire key being mapped to 'error'.

  Is there a better way to do this, or can AMD be updated to work as
above ? I do not wish to have to create a map containing hosts and their
respective filesystems. Nor do I wish to have to rebuild the filesystem
hierarchies to ensure they are unique across the network. If I do, then
it isn't worth the switch. I'd appreciate suggestions, and possible even
better, more advanced and varied examples of real AMD maps in use.

  Output from 'amd -v' :

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.
amd 5.2.2.2 of 1992/05/31 16:53:21 bsd44-alpha #0: Thu Nov 18 23:42:32 PST 1993
Built by eric@ren.cs.pdx.edu for a sun3 running sos4 (big-endian).
Map support for: root, passwd, union, nis, file, error.
FS: ufs, nfs, nfsx, host, link, linkx, program, union, auto, direct, 
    toplvl, error.
Primary network is 131.252.20.0.


  Thanks.

-eric

-- 
  Eric Berggren             |  "We are Microsoft. UNIX is irrelevant.
  Portland State University |    OS/2 is irrelevant. Openness is futile.
  eric@ee.pdx.edu           |    Prepare to be assimilated." by prs@turing.org