[OpenAFS-devel] Suggestion for Linux init script

Atro Tossavainen Atro.Tossavainen@helsinki.fi
Wed, 21 Jan 2004 10:00:11 +0200 (EET)


Hi all,

Since the OpenAFS client has a hard time if the client disk cache is
not on a particular type of partition (kernel oopses and machine panics),
what about an addition to the init script that would check the type of
the partition it's on and refuse to start if it's a known bad one?

Something like (for Linux)

cachepartition=`df /usr/vice/cache|grep -v Filesystem|cut -f1 -d" "`
fstype=`mount | grep $cachepartition | cut -f5 -d" "`

if [ "x$fstype" != "xext2" ]; then
	# refuse to start afsd unless memcache is involved
else
	# go about it as usual
fi

I've hacked something similar on a HP-UX box with Transarc AFS 3.4:

LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
OPTIONS=$MEDIUM
MEMCACHE=`echo $OPTIONS | grep memcache`
...
CACHE=`cut -f2 -d: /usr/vice/etc/cacheinfo`
CACHEMNT=`df $CACHE | cut -f2 -d'(' | cut -f1 -d\ `
CACHEFS_LOGGING=`mount | grep $CACHEMNT | grep log`

if [ ! -z "$CACHEFS_LOGGING" -a -z "$MEMCACHE" ]; then
    echo "$CACHE is on a VxFS partition, which is illegal."
    echo "Memcache is :$MEMCACHE:"
    echo "Running afsd would panic the machine. Not starting AFS."
    exit 2
fi

I seem to remember I had something similar somewhere for Tru64 and
AdvFS, but can't find it now.

-- 
Atro Tossavainen (Mr.)               / The Institute of Biotechnology at
Systems Analyst, Techno-Amish &     / the University of Helsinki, Finland,
+358-9-19158939  UNIX Dinosaur     / employs me, but my opinions are my own.
< URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS