Operating System - HP-UX
1823416 Members
2784 Online
109655 Solutions
New Discussion юеВ

NIS Question - auto.home and auto.user

 
Kat Parkison
Occasional Advisor

NIS Question - auto.home and auto.user

Dear All ,

Problem Definition -
We use NIS and autofs. Currently we have auto.user and auto.home maps in our NIS. How to make "cd /home/joe" and "cd /user/joe" work only with one "auto.home" map.

We merged two NIS Domains recently. One of the NIS Domains had auto.user map for user home directories while the other NIS Domain had auto.home map for the user home directories.
After the two NIS Domains were merged and a new NIS Domain is created, we have both auto.user and auto.home maps in the new NIS Domain. We had to keep both the maps because different scripts still reference auto.user and auto.home maps.
We have 1200 users and their home directories reside on different file servers.

Both auto.home and auto.user maps point to SAME PHYSICAL LOCATIONS. cd /user/USER_NAME and cd /home/USER_NAME takes to the SAME LOCATION. i.e. /home/joe and /user/joe point to the same place.
Now we want to get rid of auto.user map COMPLETELY. But at the same time we should ensure that "cd /user/joe" SHOULD WORK even if the "auto.user" map is NOT there.
Please advice me on this auto.home and auto.user issue.
Thanking you all.
-Shashi Divekar
I LIKE HP-UX
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: NIS Question - auto.home and auto.user

I think you might be able to defined this in your auto.master file to achieve it. Lets say both your maps (auto.master and auto.user) looks like this ..

auto_master
===========
/home /etc/auto_user
/user /etc/auto_user

auto_user
=========
joe mars:/home/joe
jim mars:/home/jim
mary venus:/users/mary
* earth:/users/&

This should mean say for "joe", "jim" and "mary" I should be able to reference to it via /home or /user because that have been defined in auto.master file. The last line in "auto_user" file means any other users, automount their home directory from server "earth".
Can you show how your auto.master, auto.user and auto.home look like ?

Sachin Patel
Honored Contributor

Re: NIS Question - auto.home and auto.user

Hi Shashi,

There is another way.
Say you have file server where you have home dir of all users sys1.

say user sachin's home in on sys1. i.e if I logon to work1 as user I should have sys1:/home/sachin

If I create a link sys on / file system then if I type
#cd /user/sachin it will still goes to /home/sachin

lrwxrwxrwx 1 sachin staff 12 May 16 11:46 user -> /home

Not a good idea though if you have hundred of systems.

As Chan says after seeing your auto* files we can get better idea how to approch this.

Sachin
Is photography a hobby or another way to spend $
Kat Parkison
Occasional Advisor

Re: NIS Question - auto.home and auto.user

Thanks to Chan and Sachin.
I have assigned the points.
OK. Here's my /etc/auto_master file looks like -
# Mount-point Map-name Options
/user /etc/auto.svl.user.local -rw,suid,soft,retrans=5
+auto_master

Here's my /etc/auto.svl.user.local file looks like -
dracula -rw,suid,soft,retrans=5 svlhp18,svlhp80:/luser/&

+auto.user
+auto.svl.user
+auto.direct

Again , How to remove the "auto.user" NIS Map but see to it that even after removing the Map from NIS, cd /user/joe should work and "cd /user/joe" and "cd /home/joe" should point to user Joe's home directory.

Thnak you for your response.
REgards.
-Shashi Divekar
I LIKE HP-UX
S.K. Chan
Honored Contributor

Re: NIS Question - auto.home and auto.user

/etc/auto_master
# Mount-point Map-name Options
/user /etc/auto.svl.user.local -rw,suid,soft,retrans=5
+auto_master

/etc/auto.svl.user.local
dracula -rw,suid,soft,retrans=5 svlhp18,svlhp80:/luser/&
+auto.user
+auto.svl.user
+auto.direct
=================================
First thing first .. the line "+auto_master"
is a typo right ? It should be "+auto.master" because that's how automounter maps are always referred to.
Secondly can you also show the content of auto.master, auto.user, auto.svl.user and auto.direct.
# ypcat -k auto.master > master-file
# ypcat -k auto.user > user-file
..and so on

If the file is too big just show the relevent portion of the file.

Kat Parkison
Occasional Advisor

Re: NIS Question - auto.home and auto.user

Hi Chen ,

This is the information -
1)The line "+auto_master" is NOT a typo.
2)Contents of auto.user on NIS Master looks like this (It's a 1400 lines file )-
rnarceo -rw,suid,hard,intr,retrans=5,timeo=14
3)Contents of auto.home on NIS MAster -
rnarceo -rw,suid,hard,intr,retrans=5,timeo=14 svlna3:/vol/vol5/home/userdir/rnarceo
4)The ypcat -k auto.master produces following -
/top auto.top -rw,suid,soft,retrans=5
/user auto.user -rw,suid,soft,retrans=5
/home auto.home -rw,suid,soft,retrans=5
/IT auto.IT -rw,suid,soft,retrans=5
/tools auto.tools -rw,suid,soft,retrans=5
/vlsi auto.vlsi -rw,suid,soft,retrans=5
/actlibs auto.actlibs -ro,suid,soft,retrans=5
/actpop auto.actpop -rw,suid,soft,retrans=5
/proj auto.proj -rw,suid,soft,retrans=5
/net -hosts
-rw,suid,soft,retrans=5

Regards.
- Shashi Divekar
I LIKE HP-UX
S.K. Chan
Honored Contributor

Re: NIS Question - auto.home and auto.user

For simplicity I'm excluding the line "-rw,suid,soft,retrans=5" for readability. This is how I would re-organize the NIS master maps.
1) In auto.master replace line
/user auto.user
with
/user auto.home
2) Put contents of auto.user to auto.home, only for user entries not found in auto.home. For example if you have a user "joe" in auto.user that does not exist in auto.home, the additional entry in auto.home would be ..
joe svlna3:/vol/vol5/home/userdir/joe
I'm assuming joe's home dir is in "svlna3"
3) Clean up YP distribution script, they are the "ypinit", "ypmake" and "Makefile" by deleting auto.user because you don't need that map anymore.
4) On the NIS client end /etc/auto.svl.user.local you would either delete "+auto.user" (if you don't the users home dir mounted - no access) or replace it with "+auto.home".
5) I still think your /etc/auto_master file on the client end that has "+auto_master" entry is wrong, it should be "+auto.master".
6) I would also recommend cleaning up client's end "auto_*" file so that it only has references to NIS maps, no localized entries. That's up to you.
7) Remember to restart "autofs" on client after the new maps are distributed.

I STRONGLY recommend testing the above first before making a global change.