NIS and autofs and /net

From: Rick Denoire (100.17706_at_germanynet.de)
Date: 02/21/04


Date: Sat, 21 Feb 2004 15:20:00 +0100

Hello

I incorporated a Linux client into a Sun NIS domain, "seems" to work.
According to the Redhat instructions (using RH AS 2.1), one has to add
a line to the client's /etc/passwd file like this:
+::::::
(I put it at the beginning).

After doing that and a some other things, NIS accounts can be used to
connect to the NIS domain. But a serious problem appeared with the
/net map. The intention is to find all nfs shares in the domain
beneath the directories /net/<servername>/<sharename> without having
to specify the name of the servers or shares before hand; all Sun
clients (workstations) can do that.

The automounter works fine for all indirect maps defined in the
client's own /etc/auto.master file, except for the auto_net entry. I
have tried so hard here, used even the entry
/net program:/etc/auto_net
and put an executable script in /etc/auto_net as recommended in the
autofs-Howto. This script (see below) executes fine when called with
"/etc/auto_net <servername>". For example, the command
#/etc/auto_net dbs
yields:
-fstype=nfs,soft,intr,nodev,nosuid,nonstrict \
        /export/apps dbs:/export/apps \
        /export/home dbs:/export/home
and that should be fine.
This is the script auto_net:
#!/bin/sh
key=$1
opts="-fstype=nfs,soft,intr,nodev,nosuid,nonstrict"
SHOWMOUNT="/usr/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 is my /etc/auto.master:
/misc /etc/auto.misc --timeout=60
/net program:/etc/auto_net
#/net -hosts -nosuid
#/net file:/etc/auto_net -nosuid
/home auto_home -nobrowse
/apps file:/etc/auto_apps

Then I realized that I was using autofs3. I did a rmmod, put the line
"alias autofs autofs4" in /etc/modules.conf, restarted the autofs, but
that did not seem to help. This is what lsmod reveals after that:
Module Size Used by Not tainted
autofs4 12644 4 (autoclean)

so autofs4 is being used, but a "cat /proc/filesystems" shows
"autofs").
# automount --version
Linux automount version 3.1.7

This is my /etc/nsswitch.conf:
passwd: files nis
shadow: files nis
group: files nis
hosts: nis files dns
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files nisplus
rpc: files
services: files nisplus
netgroup: nis files
publickey: nisplus
automount: files nis
aliases: nis files

so if a map file is present at the client, the NIS map won't be used,
and this is the desired behavior.

This is what I found about autofs4 in my system (kernel
2.4.9.e.30smp):
/lib/modules/2.4.9-e.30smp/kernel/fs/autofs
/lib/modules/2.4.9-e.30smp/kernel/fs/autofs/autofs.o
/lib/modules/2.4.9-e.30smp/kernel/fs/autofs4
/lib/modules/2.4.9-e.30smp/kernel/fs/autofs4/autofs4.o

When trying "cd /net/dbs" I get the following complain in the messages
file:
Feb 21 13:21:49 tuxedo automount[32644]: attempting to mount entry
/net/dbs
Feb 21 13:21:49 tuxedo automount[308]: lookup(program): lookup for dbs
failed

In /var/log/messages, after reloading /etc/init.d/autofs I got:

Feb 21 13:21:33 tuxedo automount[32644]: starting automounter version
3.1.7, path = /net, maptype = program, mapname = /etc/auto_net
Feb 21 13:21:33 tuxedo automount[32644]: using kernel protocol version
3 Feb 21 13:21:33 tuxedo automount[32671]: starting automounter
version 3.1.7, path = /home, maptype = yp, mapname = auto.home
Feb 21 13:21:33 tuxedo automount[32671]: parse(sun): unknown option:
-nobrowse
Feb 21 13:21:33 tuxedo automount[32671]: using kernel protocol version
3
Feb 21 13:21:33 tuxedo automount[32698]: starting automounter version
3.1.7, path = /apps, maptype = file, mapname = /etc/auto_apps
Feb 21 13:21:33 tuxedo automount[32698]: using kernel protocol version
3
Feb 21 13:21:33 tuxedo automount[32722]: starting automounter version
3.1.7, path = /usr/local, maptype = file, mapname = auto_local

I don't understand why version 3 of autofs was loaded at all, and why
version 4 won't work either.
I think I have done all my "home tasks", but now I am stuck.
Any help will be highly appreciated.

Bye
Rick Denoire



Relevant Pages

  • NIS and autofs and /net
    ... I incorporated a Linux client into a Sun NIS domain, ... Feb 21 13:21:33 tuxedo automount: using kernel protocol version ... Feb 21 13:21:33 tuxedo automount: starting automounter version ...
    (comp.os.linux.misc)
  • NIS and autofs and /net
    ... I incorporated a Linux client into a Sun NIS domain, ... Feb 21 13:21:33 tuxedo automount: using kernel protocol version ... Feb 21 13:21:33 tuxedo automount: starting automounter version ...
    (linux.redhat)
  • Re: How to selectively distribute NIS maps
    ... >> I have a NIS setup with Solaris 7 as the NIS Server and some Linux ... >> automounter map file, which is perfectly suitable for Sun NIS Clients, ...
    (comp.unix.solaris)
  • Weird NIS automount problem
    ... on moving all of my services over to zones on Solaris10, ... and the automounter, and need some spare eyes to help me out here. ... but NOT if I use the NIS auto.home table. ...
    (comp.unix.solaris)
  • Re: 10.3 nis autofs problem
    ... The NIS server has maps for passwd and auto.home etc. ... The problem is that ypbind binds to the NIS server and ypcat -k auto.home reveals the auto.home map, ... this leads me to think that the automounter is not using the NIS map for auto.home. ...
    (alt.os.linux.suse)