[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: autofs and OpenLDAP integration

Nalin Dahyabhai a écrit :
> On Tue, Jul 24, 2001 at 12:06:05PM +0200, Jehan PROCACCIA wrote:
> > ONE LAST QUESTION (arg !!), can I move /etc/auto.master in ldap
> Yes, but it takes a bit of work.  In a nutshell, you migrate your
> auto.master map into your directory in the same way you migrated
> auto.home.  From there, the trick is to get the autofs init script to
> look in your directory for the information it needs.
> One way to do this is to dump the information from the directory to a
> local file at boot-time using ldapsearch and to use some shell script
> magic to convert the data into the right format.
> Another way to do it is to hack the init script so that it "knows" how
> to look for data in a directory, calling ldapsearch or a similar helper
> in much the same way it uses ypcat to pull an auto.master map from an
> NIS server.  We decided to go this route, and since no hard-coded
> combination of using files, NIS, and LDAP could make everyone happy
> (something which we've found out the hard way), we hacked in a primitive
> form of support for parsing the automount: line in /etc/nsswitch.conf.
> I've put the patch for the init script and the source for the helper it
> uses, in http://people.redhat.com/nalin/autofs/.
> Cheers,
> Nalin

I don't know how it worked, but I managed to run the auto.master info
into ldap without any patching !?, as I said in my lattest mail:

Even BETTER: include auto.master in ldap, no more /etc/auto.master.

for the configuration above, here's what I add:

dn: ou=auto.master,dc=int-evry,dc=fr
objectClass: top
objectClass: automountMap
ou: auto.master

dn: cn=/mci, ou=auto.master,dc=int-evry,dc=fr
objectClass: automount
cn: /mci

$grep automount /etc/nsswitch.conf
automount: ldap

$/etc/init.d/autofs status
Configured Mount Points:
/usr/sbin/automount /mci ldap
openldap.int-evry.fr:ou=auto.mci,dc=int-evry,dc=fr -rw,intr,soft,quota

Active Mount Points:
/usr/sbin/automount /mci ldap
openldap.int-evry.fr:ou=auto.mci,dc=int-evry,dc=fr -rw,intr,soft,quota
/usr/sbin/automount --submount /mci/mci ldap
/usr/sbin/automount --submount /mci/em ldap

And it Works !

However, I still doubt about this as when I make the same config an an
other RH 7.1 host (automount: ldap, /etc/ldap.conf and
/etc/openldap/ldap.conf indentical) it doesn't work:

$ /etc/init.d/autofs status
Configured Mount Points:

Active Mount Points:

maybe I should use your patch on that machine.
The machine where it works (as described above), is the same machine
where the ldap server is running (openldap.int-evry.fr), I don't think
this is the reason why it works there but ???, I did also lots of
manipulation on that machine and maybe it "remembered" an old
/etc/auto.master ??, howerver I can assure you that it works for now (I
should reboot to be sure), the /etc/auto.master on that machine use
commented lines:

$more /etc/auto.master
#/mci ldap:openldap.int-evry.fr:ou=auto.mci,dc=int-evry,dc=fr
#/mci ldap:openldap.int-evry.fr:ou=mci,ou=automount,dc=int-evry,dc=fr

in http://people.redhat.com/nalin/autofs/ the readme says:

This is stuff from the Raw Hide autofs package, broken out and set here
for anyone who doesn't use SRPMS or whatever.

If there's an SRPMS I would prefer to get it an rebuild the package, is
there one and where ?


Jehan Procaccia
Institut National des Telecommunications| Email:
MCI, Moyens Communs Informatiques	| Tel  : +33 (0) 160764436 
9 rue Charles Fourier 91011 Evry France | Fax  : +33 (0) 160764321