Re: /net
From: Boyd (tbmoore_at_bealenet.com)
Date: 10/20/03
- Next message: seemd: "Linux for Government users"
- Previous message: Arshad Sheik: "Re: /net"
- In reply to: Arshad Sheik: "/net"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 19 Oct 2003 20:48:48 -0400
Arshad Sheik wrote:
> I get /net for autofs working for our environment, but the problem is
> that I can't traverse into sub dirs.
>
....
I have 2 hosts that are automounting back and forth. I am running
Debian stable on one (host: woody). And Debian unstable on the other
(host: sid).
On woody, I set the file /etc/exports to be:
# /etc/exports: the access control list for filesystems which may be
exported
# to NFS clients. See exports(5).
# / sid(rw)
/home sid(rw)
/var sid(ro)
/usr sid(ro)
/tmp sid(rw)
/overflow sid(ro)
On sid, I used the default autofs files:
/etc/auto.master contains:
# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(5).
/var/autofs/misc /etc/auto.misc
/var/autofs/net /etc/auto.net
And /etc/auto.net contains:
#!/bin/sh
# $Id: //depot/autofs-4.0/samples/auto.net#6 $
# Look at what a host is exporting to determine what we can mount.
# This is very simple, but it appears to work surprisingly well
key="$1"
# add "nosymlink" here if you want to suppress symlinking local filesystems
# Note: "nonstrict" is now set by default, remove it if you don't want it.
opts="-fstype=nfs,hard,intr,nodev,nosuid,nonstrict"
# Showmount comes in a number of names and varieties. "showmount" is
# typically an older version which accepts the '--no-headers' flag
# but ignores it. "kshowmount" is the newer version installed with knfsd,
# which both accepts and acts on the '--no-headers' flag.
#SHOWMOUNT="kshowmount --no-headers -e $key"
#SHOWMOUNT="showmount -e $key | tail +2"
# Newer distributions get this right
SHOWMOUNT="/sbin/showmount --no-headers -e $key"
$SHOWMOUNT | LC_ALL=C sort +0 | \
awk -v key="$key" -v opts="$opts" -- '
BEGIN { ORS=""; first=1 }
{ if (first) { print opts; first=0 }; print "
\\\n\t" $1, key ":" $1 }
END { if (!first) print "\n"; else exit 1 }
'
This latter is a shell script which returns the following when it is
executed by the autofs daemon:
(I get this when I run the script: /etc/auto.net woody):
-fstype=nfs,hard,intr,nodev,nosuid,nonstrict \
/home woody:/home \
/overflow woody:/overflow \
/tmp woody:/tmp \
/usr woody:/usr \
/var woody:/var
If I remember correctly, if the auto.xxx file is a script, it is
executed and it output takes the place of what would normally be read
from the file auto.xxx. In other words, I believe it would work if I
created auto.net to contain the lines above in the file.
I hope this helps. I have no trouble going down into the subdirectories.
One thing I would ask, in your case, is the subdirectory on the same
mount point as the parent? If not, you will have to mount it
separately, and also exportfs it.
Boyd
- Next message: seemd: "Linux for Government users"
- Previous message: Arshad Sheik: "Re: /net"
- In reply to: Arshad Sheik: "/net"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|