autofs + cachefs quandry

From: Aaron M. Hirsch (ahirsch@lenexa.sema.slb.com)
Date: Thu Apr 03 2003 - 13:43:32 EST


All,

I have a SunFire 280R which I'm working on configuring as a "centralized" NFS
server. Initially I want to share the contents of the 280R, utilizing
cachefs as there should not be writes to the filesystem, to approximately 350
Solaris 6/8/9 machines. I can successfully mount the /local filesystem to
all the machines manually. I want the remote mount points to be
/usr/local/$OSREL - where OSREL is either 5.6 5.8 5.9. The following is the
contents of one of the /etc/init.d/autofs scripts:

#!/sbin/sh
#
# Copyright (c) 1993-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)autofs 1.8 01/11/27 SMI"

case "$1" in
'start')
        /usr/lib/autofs/automountd -D OSREL=5.9 \
        </dev/null >/dev/msglog 2>&1
        /usr/sbin/automount &
        ;;

'stop')
        /sbin/umountall -F autofs
        /usr/bin/pkill -x -u 0 automountd
        ;;

*)
        echo "Usage: $0 { start | stop }"
        ;;
esac
exit 0

Note that 5.9 is replaced with 5.8/5.6 on the perspective machines as
necessary.

Here are the contents of the /etc/dfs/dfstab on the 280R:

bash-2.05# cat /etc/dfs/dfstab
# Place share(1M) commands here for automatic execution
# on entering init state 3.
#
# Issue the command '/etc/init.d/nfs.server start' to run the NFS
# daemon processes and the share commands, after adding the very
# first entry to this file.
#
# share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource]
# .e.g,
# share -F nfs -o rw=engineering -d "home dirs" /export/home2
#
share -F nfs -o ro -d "Local Directory" /local

The machines are all running on NIS, will be migrated to LDAP later this year,
and in the /var/ypsrc/auto_local file here is what I have:

# cat auto_local
/usr/local -fstype=cachefs,cachedir=/local-cache,backfstype=nfs
newfs:/local/$OSREL

The original contents of the /var/ypsrc/auto_local file were:

# cat auto_local
/usr/local -intr fs1:/local/$OS

With /etc/init.d/autofs originally being:

# Copyright (c) 1993, by Sun Microsystems, Inc.
#
#ident "@(#)autofs 1.4 96/08/20 SMI"

killproc() { # kill the named process(es)
        pid=`/usr/bin/ps -e |
             /usr/bin/grep $1 |
             /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
        [ "$pid" != "" ] && kill $pid
}

#
# Start/stop automounter
#

case "$1" in

'start')
        /usr/lib/autofs/automountd -D OS=sun5\
                < /dev/null > /dev/console 2>&1 # start daemon
        /usr/sbin/automount & # do mounts
        ;;

'stop')
        /sbin/umountall -F autofs # undo mounts
        killproc automoun # kill daemon
        ;;
*)
        echo "Usage: /etc/init.d/autofs { start | stop }"
        ;;
esac

Now the problem is that in the original configuration when users would access
/usr/local they were automatically dropped into /usr/local/sun5.

With the new solution the are not put anywhere...the mount doesn't work at
all! However if I change the location of the mount point from /usr/local to
some fictional place such as /junk users ARE put into /junk/$OSREL as
expected.

This is very odd and am looking for some help in resolving the issue. Of
course I will provide a summary.

TIA!

-- 
Aaron M. Hirsch
SchlumbergerSema - NAM
UNIX Systems Administrator
11146 Thompson Ave.
Lenexa, KS 66219
Mobile:  (913) 284-9094
Phone:  (913) 312-4700 ext. 4717
EMail:  ahirsch@slb.com
Fax:  (913) 312-4701
				"The problem lies between the chair and keyboard..." JC
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:07 EDT