SUMMARY: automount using NIS on 4.1.3

From: Sumner Hushing (hushing@gdwest.gd.com)
Date: Wed Oct 20 1993 - 13:27:43 CDT


Thanks again, fellow Sun Managers, for a really impressive response!
I could get used to peer support like this really easily. :-)

I asked for hints bringing up automount under 4.1.3, using NIS maps.

In summary, after a long weekend of experimenting, my small network of
SPARC 10's running 4.1.3 is now using NIS-published automounter maps,
which is exactly what I wanted. The excerpts of the files I changed
are at the end. Here's what I found out, nothing new for those of you
who've done it, maybe some help for those who haven't:

Several people sent me copies of their Makefile, auto.master,
auto.home, auto.direct, and other files. I had a great time, wading
through it all, while watching TV the other night.

I was amazed to discover that the Makefile entries I needed were
present in the /var/yp/Makefile by default, had been deleted by our
previous sysadmin, and are readily available for reference, in
/usr/lib/NIS.Makefile. Also, there's a spot in TFM (I found it in
answerbook, search for automount*), which told me exactly what to type
in for the auto.master and other auto.xxx entries.

It was suggested that use of the auto.direct map is a "bad" way to go,
because automount doesn't reread an updated direct map until it's
restarted. Except, I changed it and noticed that automount did catch
the change right away. (?)

I also tried setting up an indirect map for /home, but had some real
problems. Probably due to the way I tried to automate the switchover
to automounting. I used to have almost everything accessible through
/home with symbolic links pointing to subdirectories on the mounted
volumes where they really were. So, to create the auto.home map, I
just did an ls -l on /home, and edited the resultant listing into a NIS
auto.home map. I must've had some errors in there, because every time
I tried it, my clients would hang up during boot, with screenfuls of
messages which I don't remember now, stuff I haven't seen in the past
two years of administering these systems. I gave up, and moved the
entries to auto.direct, adding full pathnames, and for some reason it
worked better. Maybe some day, I'll go back for more punishment, and
try it again. Maybe even RTFAB for the zillionth time.

Someone (Brian?) said they couldn't publish auto.master, but their
other maps worked ok. My auto.master is published now, and works fine,
with no extra effort.

I tried renaming /var/spool/mail to /var/spool/mail.dir on the server,
and automounting it as /var/spool/mail from auto.direct, but started
getting permission and other strange problems, so I went back to
hard-mounting it from /etc/fstab on all machines. Anybody know what
gives? Something special about the mail directory?

I've included the relevant excerpts from the files I touched below.

----------------------------------------------------------------------
My automounter startup in /etc/rc.local is now the plain generic kind
out of the box:
----------------------------------------------------------------------
        automount && echo -n ' automount'

----------------------------------------------------------------------
I keep the auto.xxx files which are used to drive NIS in /var/etc:
----------------------------------------------------------------------
-rw-rw-r-- 1 root 5001 Oct 15 21:23 auto.direct
-rw-rw-r-- 1 root 106 Oct 15 21:23 auto.master

----------------------------------------------------------------------
My auto.master map refers to auto.direct as an NIS map (no /path):
----------------------------------------------------------------------
/- auto.direct -rw,intr,hard,noquota

----------------------------------------------------------------------
My auto.direct map has all my automounts specified:
----------------------------------------------------------------------
/abc1home -rw,intr,hard,noquota abc1:/home
/abc3home -rw,intr,hard,noquota abc3:/home
/home/public -rw,intr,hard,noquota abc:/home/public.dir
/usr/Liken -rw,intr,hard,noquota abc:/usr/Liken.dir
... (plus dozens more for apps and users home directories) ...

----------------------------------------------------------------------
My /var/yp/Makefile has new entries for making auto.master and
auto.direct:
----------------------------------------------------------------------
VDIR=/var/etc
DOM=`domainname`
NOPUSH=""
YPDIR=/usr/etc/yp
YPDBDIR=/var/yp
YPPUSH=$(YPDIR)/yppush
MAKEDBM=$(YPDIR)/makedbm
...
all: ...
        auto.master auto.direct \
...
auto.master.time: $(VDIR)/auto.master
        -@if [ -f $(VDIR)/auto.master ]; then \
                sed -e "/^#/d" -e s/#.*$$// $(VDIR)/auto.master \
                | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.master; \
                touch auto.master.time; \
                echo "updated auto.master"; \
                if [ ! $(NOPUSH) ]; then \
                        $(YPPUSH) auto.master; \
                        echo "pushed auto.master"; \
                else \
                : ; \
                fi \
        else \
                echo "couldn't find $(VDIR)/auto.master"; \
        fi
...
auto.direct.time: $(VDIR)/auto.direct
        -@if [ -f $(VDIR)/auto.direct ]; then \
                sed -e "/^#/d" -e s/#.*$$// $(VDIR)/auto.direct \
                | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.direct; \
                touch auto.direct.time; \
                echo "updated auto.direct"; \
                if [ ! $(NOPUSH) ]; then \
                        $(YPPUSH) auto.direct; \
                        echo "pushed auto.direct"; \
                else \
                : ; \
                fi \
        else \
                echo "couldn't find $(VDIR)/auto.direct"; \
        fi
...
auto.master: auto.master.time
auto.direct: auto.direct.time
$(VDIR)/auto.master:
$(VDIR)/auto.direct:

----------------------------------------------------------------------
Several people mentioned master and slave NIS servers, but I haven't
done any reading about setting up and maintaining a slave yet. I
think it needs to be next on the list. I have another (larger)
network, very remote (2500 miles), which has a reliability requirement
that (I thought) required me to setup each machine completely
standalone. I use rdist to maintain copies of our application, user
directories, and system files like passwd/group/hosts. It's a royal
pain, especially the user directories part, but the requirement is that
if any Sun goes down, none of the rest will notice. I'm thinking
maybe I can relax the standalone part enough to allow NIS maps for
passwd/group/hosts/aliases, if I have a couple of slave servers on the
same net for backup in case the master NIS server goes down.

I think that about covers it. Quite a foray into the unknown for me,
but educational. Thanks again to all who responded. Some asked
questions. If they're not answered by the summary, let me know, and
I'll reply directly.

        Sumner

+-----------------------+----------------------------+-----------------+
| Sumner K Hushing III | GENERAL DYNAMICS | This space |
| hushing@gdwest.gd.COM | Space Systems Division | intentionally |
| 619-547-5791 | PO Box 85990, MZ 43-8660 | left blank |
| 619-547-4542 (lab) | San Diego, CA 92186-5990 | :-) |
+-----------------------+----------------------------+-----------------+

Thanks to:
bernards@ECN.NL (Marcel Bernards)
Claus Assmann <ca@informatik.uni-kiel.de>
pallas@oclc.org (George Pallas)
Andrew Benson <drew@mtu.edu>
camm@fmlrnd.co.uk (Ian Camm - Systems Administrator)
brian@arthur.melpar.esys.com (Brian Decker)
js@iok.unit.no
bert@penril.com (Bert Robbins)
odinba!odin!jeff@uunet.UU.NET (Jeff Tate)
feldt@phyast.nhn.uoknor.edu (Andy Feldt)
baumann@proton.llumc.edu (Michael Baumann)
Ralph.Sobek@cerfacs.fr
Anthony.Worrall@reading.ac.uk (Anthony Worrall)
sozoa@atmel.com (Steve Ozoa)



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:26 CDT