[svlug] What happens if LDAP server is unavailable?

Jeremy Hunt jh-svlug at frostypenguin.net
Thu Sep 9 16:13:00 PDT 2004



Mark wrote:

>Hi,
>
>I am planning on starting to use LDAP for userid/password and group
>management.
>Everything is working fine and it was not a big problem setting it up, but I
>am wondering what the effects will be if the machines are for some reason
>not able to reach the LDAP server(s) any more.
>The most critical processes are mysql databases as well as tomcat and apache
>webservers serving static files and servlets.
>Closely following in importance are email servers. What are the implications
>for those processes if the LDAP server is not available any more?
>  
>
Potentially bad. Some apps get really unhappy when they can't find out 
who they are anymore. There's a couple of ways around it. nscd or local 
user accounts for applications. You could set something like this up:

# getent passwd|grep mysql
mysql:*:27:27:MySQL Server:/var/lib/mysql:/bin/bash   <- This *'d 
account is in the local passwd file
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash   <- This account is 
in LDAP

but as long as you have "use_first_pass" specified for pam_ldap.so, 
which it is by default on RH, you will bypass the locked mysql account 
in the passwd file and auth against the LDAP mysql account without being 
prompted for a password a second time. These lines are from the 
/etc/pam.d/system-auth

auth        required      /lib/security/$ISA/pam_env.so
auth        sufficient    /lib/security/$ISA/pam_unix.so likeauth nullok
auth        sufficient    /lib/security/$ISA/pam_ldap.so use_first_pass
auth        required      /lib/security/$ISA/pam_deny.so

This way it the application doesn't lose it's identity if LDAP goes 
away, but you also don't lose the value of LDAP by having the account 
completely local.

Probably a better solution would be something like this from padl.com:

http://www.padl.com/OSS/pam_ccreds.html

but I haven't used it. But this looks like exactly what it's for.

>I noticed that users can not be authenticated any more (of course) but also
>authenticating local users (root) takes much longer, probably because the
>authentication module is waiting for the LDAP timeout first.
>  
>
The default 30 second timeouts are a bit long in most cases, especially 
if you have multiple servers. You can change that in /etc/ldap.conf

>I do not use the LDAP server for mysql authentication or anything that has
>to do with servlets, except for the fact that the class- and other files the
>servlets are using belong to users/groups that are defined in the LDAP
>server and would then be unknown.
>Would this be a problem for the web or DB server processes/daemons as long
>as I do not restart them while the LDAP servers are unavailable?
>
>Any hints/ideas would be appreciated.
>
>Thanks,
>
>MARK
>
>
>_______________________________________________
>svlug mailing list
>svlug at lists.svlug.org
>http://lists.svlug.org/lists/listinfo/svlug
>  
>




More information about the svlug mailing list