[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: AUTOFS + LDAP Doubt. /skole mount point or /skole/tjener/home0 mount point?



Sergi Tur/SGA/UPC wrote:
> 
> Hello everybody!
> 
> First of all sorry for my English. I have been mounting a SkoleLinux
> network for a Spanish association in Barcelona. We have some problems
> concerning with workstations and acces to file server.
> 
> I have a doubt with mountpoints that AUTOFS+ lDAP use to mount de user's
> HOME

Well, it works, And I'll try to explain why.

> My case:
> File: /etc/default/autofs
....

> 
> File: /etc/init.d/autofs
> ===============
...

> 
> But in /etc/exports we export /skole/tjener/home0
...
> 
> I think that is an error. It is?

nope. This is correct. I'll try to explain later.

> 
> I test in a workstation
> 
> $ mount -t nfs tjener:/skole /skole
> mount: tjener:/skole failed, reason given by server: Acces denied

The reason for this is that /skole is not exported from the server.
But you're not using automount here, you are using regular mounting. But
if you take look in /etc/auto.master on the client, you will find that
/skole is automounted, and subfolders should be looked up using ldap.

> $ mount -t nfs tjener:/skole/tjener/home0 /skole
> OK!

Still not using automount, and in fact, doing so will break the
automount system (until you unmount tjener:/skole/tjener/home0 from /skole)

> Moreover in workstations we don't have a /skole/tjener/home0 folder. We
> only have a /skole folder. Is this correct?

Yes. Log in as root on the workstation, and do an "ls /skole"

If noone is logged in you will find that /skole exists, but seems empty
if someone was logged in (either at that point or recently), you will
find /skole/tjener.
If it's not mounted, it's kind of hard to imagine that you could in fact
enter into /skole/tjener, when it dont exists.
Well that's automounting.
We face that problem if we creates /skole/tjener/shared/teachers, and
exports that from the server. when the teachers (teachera) logs in
/skole/tjener/home0 is mounted, just because the homefolder is
/skole/tjener/home0/teachera. First, the workstation "enters" in to
/skole. Since that is an mountpoint it will exists. In fact, if it's not
there, it will be created when automount starts.
Then /skole/tjener is mounted. Since /skole is an automount share, and
uses ldap, the info is looked up using ldap.
take a search as
 ldapsearch -xLLL "(|(cn=tjener)(ou=tjener))"

You then will see that /skole/tjener is another automountpoint. You will
see a lot of resemblancse (correct spelling?) with the entry in the file
/etc/auto.master.

OK, /skole/tjener is mounted, and we'll continue to /skole/tjener/home0
 ldapsearch -xLLL "(|(cn=home0)(ou=home0))"

There you will see that this mountpoint should be mounted from
"tjener:/skole/tjener/home0" using the options
 rw,rsize=8192,wsize=8192,intr

In Fact, there is nothing that says that the exported folder
(skole/tjener/home0) has to be mounted on the same mountpoint on the
server. In my lab, I have a server exporting /bzzware/bzzhome (using
nfs), but ldap tells my workstations to mount the folder at
/skole/tjener/home0

Well, maybe that was better suited to confuse you all :)

But the point is, we can have a lot of things mounted under /skole

I often end up with a structure like
/skole
      /tjener
             /home0
             /students
             /teachers
             /shared
                    /teachers
                    /web
                    /scratch

of these, only these folders are exported through nfs from the main-server:
 /skole/tjener/home0
 /skole/tjener/students
 /skole/tjener/teachers
 /skole/tjener/shared/teachers
 /skole/tjener/shared/web
 /skole/tjener/shared/scratch


-- 
Finn-Arne Johansen
faj@bzz.no http://bzz.no/
Debian-edu developer and solution provider



Reply to: