Hi,
I'm using Autofs and LDAP for mounting my home directories via nfs. In general, everything seems to work fine. However, I have one small problem. If I reboot my server using autofs while my LDAP server is down, I get the following error message in my logs:
automount[3358]: bind_ldap_anonymous: lookup(ldap): Unable to bind to the LDAP server: (default), error Can't contact LDAP server
which is understandable, since my ldap server is temporarily down.
My problem, however, is that once my ldap server is back up, autofs never seems to retry to connect to it, so all my /home mounts fail. Basically, it means I have to make sure that my LDAP server is never down while another server is rebooting.
I figure there must be something in the configuration file that would allow me to tweak this to indicate to autofs to recheck the ldap server periodically to see if it has come back up, but can't seem to find anything.
My /etc/sysconfic/autofs file is pretty plain: # TIMEOUT - set the default mount timeout (default 600). # TIMEOUT=300
# LOGGING - set default log level "none", "verbose" or "debug" # LOGGING="verbose"
# Other common LDAP nameing # MAP_OBJECT_CLASS="automountMap" ENTRY_OBJECT_CLASS="automount" MAP_ATTRIBUTE="ou" ENTRY_ATTRIBUTE="cn" VALUE_ATTRIBUTE="automountInformation"
Is there anything I can do to force autofs to check to see if my LDAP server is back online?
Thanks,
Eric
I'm using Autofs and LDAP for mounting my home directories via nfs. In general, everything seems to work fine. However, I have one small problem. If I reboot my server using autofs while my LDAP server is down, I get the following error message in my logs:
I can't help you - but can you help me by pointing me to the docs you used to get this far?
thanks, -Alan
"Alan McKay" alan.mckay@gmail.com wrote in message news:844129e80912011526o16aa6aen206a1cf7676a5b0e@mail.gmail.com...
I'm using Autofs and LDAP for mounting my home directories via nfs. In general, everything seems to work fine. However, I have one small problem. If I reboot my server using autofs while my LDAP server is down, I get the following error message in my logs:
I can't help you - but can you help me by pointing me to the docs you used to get this far?
Holy cow. It wasn't easy... I had to do a lot of digging around to find the necessary stuff, and unfortunately, don't have all the links any more. I did a lot of searching online using LDAP and autofs as query strings. Some of the links I found were the following that helped me understand. Mind you, none were "howto" recepies as such.
http://www.linuxtopia.org/online_books/rhel5/rhel5_administration/rhel5_s1-n... http://www.openldap.org/faq/data/cache/599.html
In a nutshell (if memory serves properly), you needed to do the following (this is all assuming you already have a functional LDAP server up and running and properly configured in your nsswitch.conf files and your ldap.conf files, etc).
1) Add the autofs schema to your ldap server (add the following line to the slapd.conf file: include /etc/openldap/schema/redhat/autofs.schema). I don't remember if I already had the autofs.schema file or not, or if I had to search for it.
2) Modify your /etc/sysconfig/autofs to uncomment: # MAP_OBJECT_CLASS="automountMap" ENTRY_OBJECT_CLASS="automount" MAP_ATTRIBUTE="ou" ENTRY_ATTRIBUTE="cn" VALUE_ATTRIBUTE="automountInformation"
3) Create an ldif file and import into your LDAP server to show the following. Note, that my NFS server has the home directories located at /var/nfs/home/<user name>. Your mapping may be different.
dn: ou=auto.home,dc=domain,dc=com objectClass: top objectClass: automountMap ou: auto.home
dn: cn=/,ou=auto.home,dc=domain,dc=com objectClass: automount cn: / automountInformation: -rsize=8192,wsize=8192,intr nfs_server.domain.com:/var/nfs/home/&
dn: ou=auto.master,dc=domain,dc=com objectClass: top objectClass: automountMap ou: auto.master
dn: cn=/home,ou=auto.master,dc=domain,dc=com objectClass: automount cn: /home automountInformation: ldap:ldap_server.domain.com:ou=auto.home,dc=domain,dc=com
4) Cross your fingers and restart your ldap server and your autofs daemon and hope it works. I got this working on CentOS 5.3.
Hope this helps. I remember having to do a lot of digging around, a lot of searching and a lot of trial and error to get it working. But hopefully the above points should at least set you off in the correct path. Keep in mind I am by far no expert - I just poked around until I got it working, and once I did, stepped away from it.
Good luck.
Eric
On Fri, Nov 27, 2009 at 12:30 PM, Eric B. ebenze@hotmail.com wrote:
My problem, however, is that once my ldap server is back up, autofs never seems to retry to connect to it, so all my /home mounts fail. Basically, it means I have to make sure that my LDAP server is never down while another server is rebooting.
I figure there must be something in the configuration file that would allow me to tweak this to indicate to autofs to recheck the ldap server periodically to see if it has come back up, but can't seem to find anything.
Once the server is back up, does restarting the autofs daemon fix the behaviour?
Also, try setting the logging to debug.. Might give you a better idea of why it's not reconnecting.
Kwan Lowe wrote, On 12/02/2009 07:07 AM:
On Fri, Nov 27, 2009 at 12:30 PM, Eric B. ebenze@hotmail.com wrote:
My problem, however, is that once my ldap server is back up, autofs never seems to retry to connect to it, so all my /home mounts fail. Basically, it means I have to make sure that my LDAP server is never down while another server is rebooting.
I figure there must be something in the configuration file that would allow me to tweak this to indicate to autofs to recheck the ldap server periodically to see if it has come back up, but can't seem to find anything.
Once the server is back up, does restarting the autofs daemon fix the behaviour?
Also, try setting the logging to debug.. Might give you a better idea of why it's not reconnecting.
Perhaps the following links from an autofs list thread will point to something for Eric: subject: "[autofs] ldap and reloading" http://linux.kernel.org/pipermail/autofs/2009-June/005775.html http://linux.kernel.org/pipermail/autofs/2009-June/005779.html
BTW the 'how to' debug Autofs is at: http://people.redhat.com/jmoyer/
"Todd Denniston" Todd.Denniston@tsb.cranrdte.navy.mil wrote in message news:4B168426.9030805@tsb.cranrdte.navy.mil...
Kwan Lowe wrote, On 12/02/2009 07:07 AM:
On Fri, Nov 27, 2009 at 12:30 PM, Eric B. ebenze@hotmail.com wrote:
My problem, however, is that once my ldap server is back up, autofs never seems to retry to connect to it, so all my /home mounts fail. Basically, it means I have to make sure that my LDAP server is never down while another server is rebooting.
I figure there must be something in the configuration file that would allow me to tweak this to indicate to autofs to recheck the ldap server periodically to see if it has come back up, but can't seem to find anything.
Once the server is back up, does restarting the autofs daemon fix the behaviour?
Also, try setting the logging to debug.. Might give you a better idea of why it's not reconnecting.
Perhaps the following links from an autofs list thread will point to something for Eric: subject: "[autofs] ldap and reloading" http://linux.kernel.org/pipermail/autofs/2009-June/005775.html http://linux.kernel.org/pipermail/autofs/2009-June/005779.html
BTW the 'how to' debug Autofs is at: http://people.redhat.com/jmoyer/
Thanks for the links. Not exactly what I need, but maybe an alley to help me down the path. In the meantime, if anyone else has any suggestions what I can do, would love to hear about it.
Thanks,
Eric
2009/12/2 Eric B. ebenze@hotmail.com:
In the meantime, if anyone else has any suggestions what I can do, would love to hear about it.
Do you just have the one LDAP server? I would probably set up a slave and add it to your client's ldap configuration.
Ben
"Benjamin Donnachie" benjamin@py-soft.co.uk wrote in message news:732076a80912020835u4cc87abwb3633c40320e8caf@mail.gmail.com... 2009/12/2 Eric B. ebenze@hotmail.com:
In the meantime, if anyone else has any suggestions what can do, would love to hear about it.
Do you just have the one LDAP server? I would probably set up a slave and add it to your client's ldap configuration.
Yes - thanks. Actually, my problem has to do with sequencing. I'm running most of my servers as Virtual Machines, so if/when a Virtual Host reboots, all the vms on it reboot as well. If any of the other vms happen to boot prior to the ldap servers, I run into this problem. So I'm trying to figure out if there is a way around this, apart from making sure never to boot both the ldaps at the same time.
Thanks,
Eric
"Kwan Lowe" kwan.lowe@gmail.com wrote in message news:b7e478370912020407p35def217td1bcf579d7bb83aa@mail.gmail.com... On Fri, Nov 27, 2009 at 12:30 PM, Eric B. ebenze@hotmail.com wrote:
My problem, however, is that once my ldap server is back up, autofs never seems to retry to connect to it, so all my /home mounts fail. Basically, it means I have to make sure that my LDAP server is never down while another server is rebooting.
I figure there must be something in the configuration file that would allow me to tweak this to indicate to autofs to recheck the ldap server periodically to see if it has come back up, but can't seem to find anything.
Once the server is back up, does restarting the autofs daemon fix the behaviour?
Yes. Restarting autofs daemon causes it to reconnect to the ldap server, and all automounts work properly at that point.
Also, try setting the logging to debug.. Might give you a better idea of why it's not reconnecting.
I tried, but I got not additional useful information out of the automounter. Basically, it says that it failed to connect to ldap server, and never retries. But nothing particularly more useful (to me at least) there.
Any ideas of lists or groups that I can try otherwise? I've tried posting to the kernel.autofs mailing list, but for some reason my posts never make it on. I even tried mailing the list admins but got no response back from them either.
Thanks,
Eric