1751703 Members
5026 Online
108781 Solutions
New Discussion юеВ

Re: Automounter & NIS

 
Gary Cooper_1
Esteemed Contributor

Automounter & NIS

I am just seting up a NIS environment on HP-UX 10.20 for the first time. All of my users home directories reside on the machine which is also my NIS master server. I have passwd, group & hosts working OK.
I am wanting to set up automounter to work with NIS, so that for any new users, all I have to do is add an entry on the NIS master server and not update /etc/fstab on all of my hosts.

I think it's nearly there, but when I stopped and restarted nfs client, it reported:
automount: user1 must start with a '/'
automount: user2 must start with a '/'
etc.

I am trying to use an indirect map and (believe) I have enabled autofs.
5 REPLIES 5
Gary Cooper_1
Esteemed Contributor

Re: Automounter & NIS

Oh, I forgot, my auto_home file looks like:

user1 host:/home/user1
user2 host:/home/user2
:
Donald Kok
Respected Contributor

Re: Automounter & NIS

Does your auto_master look like
/home auto_home [options]

the auto mount proces mount the /home piece to the username piece in the auto_home, so the full path becomes /home/user1
My systems are 100% Murphy Compliant. Guaranteed!!!
steven Burgess_2
Honored Contributor

Re: Automounter & NIS

Hi Gary

I have never done this and revising at home at the moment but here are a few things to check

On your nis/nfs server

Check

/etc/exports file has

/home/user1 -access=
/home/user2 -access=

in

/etc/rc.config.d/nfsconf

NFS_CLIENT=0
NFS_SERVER=1
NUM_NFSD=4
NUM_NFSIOD=4
PCCNFS+SERVER=0
START_MOUNTD=1

Run

/sbin/init.d/nfs.core start
/sbin/nfs.server start

The nfs.server start script initiates the exportfs command which can be run after making changes manually with

exportfs -a

On your client

Create your mount point

Edit /etc/rc.config.d/nfsconf and set

NFS_CLIENT=1
NFS_SERVER=0
NUM_NFSD=0
NUM_NFSIOD=4
PCNFS_SERVER=0
START_MOUNTD=0

The NFS client executes the mount -aQF nfs command during execution of the nfs.client script. So to start nfs services on the client

/sbin/init.d/nfs.core start
/sbin/init.d/nfs.client.start

If the nis client is already running

mount :/home/user1 /home

The automounter is a client side software so all configuration is done on the client

The docs state that all file systems should be exported by the NFS in the normal ways as used with the NFS client as above

The automount daemon gets its information from the master map file /etc/auto_master which contains a list of other map files and their locations

In your case you need to have in /etc/auto_master

/home /etc/auto_home

Each line starting with a / shows a direct map file. A line starting with an absolute directoy shows and indirect map

In your indirect map the following line mounts a directory /home/user1 from an nfs server to /home/user1 on the local system

To start automounter on the client

/sbin/nfs.client start

ensure in you /etc/rc.config.d/nfsconf file you have

AUTOMOUNT=1
AUTO_MASTER="/etc/auto_master"
AUTO_OPTIONS="-f $AUTO_MASTER"

If you modify your automounter maps follow these rules

If you change a master map, kill the automount daemon with kill -TERM , do not use -9

If you modif options or the server part in a direct map you don't have to restart the daemon. If you modify a mount point you have to restart the daemon

There is no need to restart the daemon if you modify an indirect map

HTH

Steven

ps. Thanks for supplying the question that prompted me to sit at my desk instead of watching the golf

take your time and think things through
Hartmut Lang
Trusted Contributor

Re: Automounter & NIS

Use a direct-map to mount the whole /home-directory, instead a indirect map to mount each users-directory separatly:
/etc/auto_master:
/- /etc/auto.direct

/etc/auto.direct:
/home nfs-servername:/home

This is the way we do the job.
It works great if you have one filesystem with all users on the nfs-server. And if you want to export all users to all your nfs-/nis-clients.

Hartmut
steven Burgess_2
Honored Contributor

Re: Automounter & NIS

Hi

or

use a special map to mount home directories from users in /etc/passwd

in /etc/auto_master

/home -passwd

This will mount the home directories under /home/

HTH

Steve
take your time and think things through