{"id":81,"date":"2008-09-02T17:48:05","date_gmt":"2008-09-02T14:48:05","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=81"},"modified":"2008-09-02T17:48:05","modified_gmt":"2008-09-02T14:48:05","slug":"ldap-default-bindhard-policy-is-problematic","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2008\/09\/ldap-default-bindhard-policy-is-problematic\/","title":{"rendered":"LDAP default &quot;bind=hard&quot; policy is problematic"},"content":{"rendered":"<p>\/etc\/ldap.conf (CentOS\/RHEL) and \/etc\/libnss-ldap.conf (Debian) has an interesting line:<\/p>\n<blockquote><p># Reconnect policy: hard (default) will retry connecting to<br \/>\n# the software with exponential backoff, soft will fail<br \/>\n# immediately.<br \/>\n<strong># bind_policy hard<\/strong><\/p><\/blockquote>\n<p>By default (when commented out) it is set to <em>hard<\/em>. This means that LDAP queries would wait &amp; retry a long period if LDAP server is down. <em>soft<\/em> means try once, and return even if failed.<\/p>\n<p>Then yet again we get the chicken &amp; egg problem.<\/p>\n<p>Long story short: on an LDAP-client+server machine, services that start before LDAP would simply freeze for a long period, if they resolve user\/group names. On CentOS it happens with the <em>dbus<\/em> service. (Even if user\/group are set locally on passwd\/group, an LDAP query would be triggered to find additional group membership).<\/p>\n<p>By the way, on Debian \"hard\" policy differs from CentOS's \"hard\" policy. Debian waits a few seconds while CentOS waits about 2 minutes. The \"how long should I wait\" params are set in the code (<em>ldap-nss.h<\/em>), and can't be tuned from the config file.<\/p>\n<p>So as a workaround I've set <em>\"bind_policy soft<\/em>\" on my LDAP server+client; but I believe that a better solution should be done. Either:<\/p>\n<ul>\n<li>Default should be <em>soft<\/em> (just like DNS default)<\/li>\n<li>CentOS timeout should be lower, like Debian<\/li>\n<li>Timeouts should be tuneable through the config file<\/li>\n<\/ul>\n<p>First two bullets are probably \"management decisions\", but I'll add the 3rd bullet to my TODO \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/etc\/ldap.conf (CentOS\/RHEL) and \/etc\/libnss-ldap.conf (Debian) has an interesting line: # Reconnect policy: hard (default) will retry connecting to # the software with exponential backoff, soft will fail # immediately. # bind_policy hard By default (when commented out) it is set to hard. This means that LDAP queries would wait &amp; retry a long period if [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[75],"tags":[198,73],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/81"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}