← Back to team overview

sslug-teknik team mailing list archive

Flush af autofs -cache?

 

Jeg benytter autofs til at mounte NFS shares igennem. Det virker
generelt ret godt at man kan lave en 
ls /net/<hostname>/
også for man listen af exporterede kataloger på serveren og kan tilgå
dem direkte. 

Problemet opstår når jeg tilføjer et nyt share på en server der er et
share mountet fra i forvejen. Så kan jeg ikke så dne til at opdatere
listen. 

showmount -e <servernavn> 
giver mig det rigtige. 

Distributionen er Ubuntu Breezy og auto.net er som i
standardopsætningen:

#!/bin/sh

# $Id: auto.net,v 1.5 2003/09/29 08:22:35 raven Exp $

# 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
# add "nonstrict" to make it OK for some filesystems to not mount
opts="-fstype=nfs,hard,intr,nodev,nosuid,nonstrict,rsize=8192,wsize=8192,async"

# 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 }
		'

Nogen der ved hvordan man får autofs, automount.. til at flushe sin
cache? 



Jesper
-- 
./Jesper Krogh, jesper@xxxxxxxx, Jabber ID: jesper@xxxxxxxxxxxx



Follow ups